If you don't specify a "query" analyzer, Solr will use the "index" analyzer at query time.

But... at query time there is something called a "query parser" which typically breaks the query into separate terms, delimited by white space, and then calls the analyzer for each term, separately.

You can put the entire query in quotes or escape the space with a backslash.

Of, just use the edismax query parser with the "pf" or "pf2" parameters and then Solr will boost exact phrase matches even if not quoted or escaped.

-- Jack Krupansky

-----Original Message----- From: prashantc88
Sent: Monday, July 21, 2014 11:29 AM
To: [email protected]
Subject: Solr schema.xml query analyser

0 down vote favorite


I am a complete beginner to Solr and need some help.

My task is to provide a match when the search term contains the indexed
field.

For example:

   If query= foo bar and textExactMatch= foo, I should not get a MATCH
   If query= foo bar and textExactMatch= foo bar, I should get a MATCH
   If query= foo bar and textExactMatch= xyz foo bar/foo bar xyz, I should
get a MATCH

I am indexing my field as follows:

<fieldType name="textExactMatch" class="solr.TextField"
positionIncrementGap="100">
           <analyzer type="index">
                   <tokenizer class="solr.KeywordTokenizerFactory"/>
                   <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
                   <filter class="solr.LowerCaseFilterFactory"/>
           </analyzer>

So I'm indexing the text for the field as it is without breaking it further
down. Could someone help me out with how should I tokenize and filter the
field during query time.




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-schema-xml-query-analyser-tp4148317.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to