Oops... that's "query analyzer", not "index analyzer", so it's:

By definition, phrase search is one of two things: 1) match on a string
field literally, or 2) analyze as a sequence of tokens as per the field type
query analyzer.

-- Jack Krupansky

-----Original Message----- From: Jack Krupansky
Sent: Friday, April 19, 2013 11:14 AM
To: solr-user@lucene.apache.org
Subject: Re: is phrase search possible in solr

By definition, phrase search is one of two things: 1) match on a string
field literally, or 2) analyze as a sequence of tokens as per the field type
index analyzer.

You could use the keyword tokenizer to store the whole field as one string,
with filtering for the whole string. Or, just make it a string field and do
literal and wildcard matches.

You can use copyField to make copies of the same input data in multiple
fields, each with different analyzers. You would then need to specify which
field you want to search, whether literal or keyword.

-- Jack Krupansky

-----Original Message----- From: vicky desai
Sent: Friday, April 19, 2013 10:59 AM
To: solr-user@lucene.apache.org
Subject: is phrase search possible in solr

I want to do a phrase search in solr without analyzers being applied to it
eg - If I search for *"DelhiDareDevil"* (i.e - with inverted commas)it
should search the exact text and not apply any analyzers or tokenizers on
this field
However if i search for *DelhiDareDevil* it should use tokenizers and
analyzers and split it to something like this *delhi dare devil*

My schema definition for this is as follows

   <fieldType name="text" class="solr.TextField"
   positionIncrementGap="100" autoGeneratePhraseQueries="false">
   <analyzer type="index">
   <tokenizer class="solr.WhitespaceTokenizerFactory" />
   <filter class="solr.WordDelimiterFilterFactory"
   generateWordParts="1" generateNumberParts="1" catenateWords="1"
   catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"
preserveOriginal="1"/>
   <filter class="solr.LowerCaseFilterFactory" />
   </analyzer>
   <analyzer type="query">
   <tokenizer class="solr.WhitespaceTokenizerFactory" />
   <filter class="solr.WordDelimiterFilterFactory"
   generateWordParts="1" generateNumberParts="1" catenateWords="1"
   catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"
preserveOriginal="1"/>
   <filter class="solr.LowerCaseFilter``Factory" />
   </analyzer>
   </fieldType>

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

any help would be appreciated




--
View this message in context:
http://lucene.472066.n3.nabble.com/is-phrase-search-possible-in-solr-tp4057312.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to