lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vishal Swaroop <vishal....@gmail.com>
Subject How to get exact match along with text edge_ngram
Date Mon, 04 May 2015 14:09:53 GMT
We have item_name indexed as text edge_ngram which returns like results...

Please suggest what will be the best approach (like "string" index (in
addition to "...edge_ngram"... or using copyField...) to search ALSO for
exact matches?

e.g. url should return item_name as "abc" entries only... I tried item_name
in quotes ("abc") but no luck...
http://localhost:8081/solr/item/select?q=item_name:abc&wt=json&indent=true
But, I get abc-1, abc-2... as result, however I only need "abc" entries.

<field name="item_name" type="text_general_edge_ngram" indexed="true"
stored="true" multiValued="false" />
<fieldType name="text_general_edge_ngram" class="solr.TextField"
positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<charFilter class="solr.MappingCharFilterFactory"
mapping="mapping-ISOLatin1Accent.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="([\.,;:-_])"
replacement=" " replace="all"/>
<filter class="solr.EdgeNGramFilterFactory" maxGramSize="30"
minGramSize="1"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="([^\w\d])"
replacement="" replace="all"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<charFilter class="solr.MappingCharFilterFactory"
mapping="mapping-ISOLatin1Accent.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="([\.,;:-_])"
replacement=" " replace="all"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="([^\w\d])"
replacement="" replace="all"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="^(.{30})(.*)?"
replacement="$1" replace="all"/>
</analyzer>
</fieldType>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message