0

i am using solr with django.In my schema i have a field

<field name="function" type="text" indexed="true" stored="true" multiValued="true" />

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.KeywordTokenizerFactory"/>
    <!-- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> -->
    <!-- in this example, we will only use synonyms at query time
    <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
    -->
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

i have indexed values like Wedding shoot,Wedding,Reception,Pre Wedding,Cocktail,Post Wedding,Engagement

i want to search for functions where the value is "Wedding shoot" when i use () it gives me values where both "Wedding shoot" and "Wedding" is present

http://localhost:8983/solr/realwedding/select?q=function%3A(wedding+shoot)&rows=100&fl=function&wt=json&indent=true

and if i use "" it returns nothing

http://localhost:8983/solr/realwedding/select?q=function%3A%22wedding+shoot%22&rows=100&fl=function&wt=json&indent=true

what i want is it to give results where it matches the full text "Wedding shoot"

thanks in advance

Roan
  • 89
  • 8

1 Answers1

0

Two tools are your friends here:

  • The "Field Analysis" page on the admin console, where you can see what happens at index and query time
  • The debug parameter, (or the [explain] transformer) which gives you a perspective of how Solr "sees" and "executes" your query and why a given document is in the search results.

On top of that, it's quite hard to guess what's going on there. The answer should be in the schema and in the definition of the RequestHandler which is serving that request.

Andrea
  • 2,714
  • 3
  • 27
  • 38