lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adm1n <evgeni.evg...@gmail.com>
Subject matching "starts with" only
Date Wed, 09 Oct 2013 18:57:47 GMT
My index contains documents which could be a single word or a short sentence
which contains up to 4-5 words. I need to return documents, which "starts
with" only from the searched pattern.
in regex it would be [^my_query].

for example, for a docs:

black
beautiful black cat
cat
cat is black
black cat

and for the query: "black"

only "black" and "black cat" should be returned.

The text field I'm using is as follows:
<fieldType name="text_general_aa" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.NGramFilterFactory" minGramSize="4"
maxGramSize="15" side="front"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.NGramFilterFactory" minGramSize="4"
maxGramSize="15" side="front"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
Solr version is 4.2

thanks!



--
View this message in context: http://lucene.472066.n3.nabble.com/matching-starts-with-only-tp4094430.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message