1

I have movie data indexed already in Solr. The basic queries are working as expected but when I fire a filter query for facets along with a q, the result is different.

The query /select?q=facetGenre:Drama&wt=xml returns results

Whereas the query /select?q=*.*&fq=facetGenre:Drama&wt=xml does not return any result.

What could the reason for this ? please help.

Since there are "\" in Genre field e.g. "Action\Adventure", it is of a custom field type "facetStringwithSlash. The details as below

<fieldType name="facetStringwithSlash" class="solr.TextField" positionIncrementGap="100">

<analyzer type="index">
<tokenizer class="solr.PatternTokenizerFactory" pattern="[/,]\s*"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="0" preserveOriginal="1" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0" stemEnglishPossessive="1"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
</analyzer>

<analyzer type="query">
<tokenizer class="solr.PatternTokenizerFactory" pattern="[/,]\s*"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" preserveOriginal="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0" stemEnglishPossessive="1"/>
<filter class="solr.ASCIIFoldingFilterFactory"/></analyzer></fieldType>
</analyzer>

</fieldType>
AnonGeek
  • 7,408
  • 11
  • 39
  • 55
Satish
  • 13
  • 3
  • What is the field type of `facetGenre`? Try setting it as string type if its not. – Jesvin Jose Nov 17 '12 at 07:26
  • Due to the fact that there can be slashes in the terms, I did not consider mapping this field to a string :(. Slash doesn't work well with filter queries in SOLR or do i need to explicitly escape slashes ? – Satish Nov 17 '12 at 07:58
  • The last point in this section says so: http://wiki.apache.org/solr/CommonQueryParameters#fq – Jesvin Jose Nov 17 '12 at 09:44
  • And this (and other SO questions) may be relevant too: http://stackoverflow.com/questions/8504477/ways-to-do-hierarchial-faceting-in-solr – Jesvin Jose Nov 17 '12 at 09:45
  • 1
    Make sure to use `*:*` rather than `*.*` – joeln Nov 17 '12 at 11:25

1 Answers1

2

As @joeln pointed out, you should use : in your query.

select?q=*:* would mean match any value in any field.

In case of select?q=*.* , since no field is specified in query, so it would search in default field, and match for any text that have . in it. Maybe that's the reason that you are not getting any hits in response.

AnonGeek
  • 7,408
  • 11
  • 39
  • 55
  • That was silly of me not to have noticed it. Expected a mound but fortunately was a mole to solve. Thanks for pointing out, Saumitra. – Satish Nov 23 '12 at 06:00