lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Re: is phrase search possible in solr
Date Fri, 19 Apr 2013 15:14:42 GMT
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. 


Mime
View raw message