You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sami al Subhi <sa...@alsubhi.me> on 2018/01/01 11:25:33 UTC

No match when querying but in admin/analysis it works!! (schema, indexed data and screen shots are provided)

data_to_be_indexed.xml
<http://lucene.472066.n3.nabble.com/file/t493675/data_to_be_indexed.xml>  
schema.xml <http://lucene.472066.n3.nabble.com/file/t493675/schema.xml>  

*above I uploaded a copy of my schema and data*

*I have this in my schema.xml*

    <field name="name_suggest_edge" type="text_suggest_edge" indexed="true"
stored="true" multiValued="true"/>

    <copyField source="name_ar" dest="name_suggest_edge" maxChars="30000" />
    <copyField source="name_en" dest="name_suggest_edge" maxChars="30000" />

    <fieldType name="text_suggest_edge" class="solr.TextField">
          <analyzer type="index">
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.WordDelimiterGraphFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="0"
catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.ArabicNormalizationFilterFactory"/>
            <filter class="solr.EdgeNGramFilterFactory" maxGramSize="20"
minGramSize="1"/>
          </analyzer>
          <analyzer type="query">
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.WordDelimiterGraphFilterFactory"
generateWordParts="0" generateNumberParts="0" catenateWords="0"
catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.ArabicNormalizationFilterFactory"/>
          </analyzer>
    </fieldType>

*when using analysis on admin page it works and it does match as you can see
from the picture below:*

<http://lucene.472066.n3.nabble.com/file/t493675/solr_analysis.png> 


*I have this doc in indexed/stored. I can match it on other fields like
name_suggest_exact or name_sugget_ngram but never matches on
name_sugget_edge. I indexed the data multiple times and index is optimized.
what could be the issue here? this is really confusing*

<http://lucene.472066.n3.nabble.com/file/t493675/name_exact.png> 
<http://lucene.472066.n3.nabble.com/file/t493675/edge.png> 




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: No match when querying but in admin/analysis it works!! (schema, indexed data and screen shots are provided)

Posted by Sami al Subhi <sa...@alsubhi.me>.
Thank Erick. Your thoughts are correct and solved the problem. I appreciate
you looking at my problem and sorry for the late reply. 

Of course, providing enough data, evidence that I've tried to solve it and
easy to understand problem structure are very important in order to
encourage others and make it easy to participate and help. It is also out of
respect to others' time. I learned this from stackoverflow.

Thank you and best regards
Sami



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: No match when querying but in admin/analysis it works!! (schema, indexed data and screen shots are provided)

Posted by Erick Erickson <er...@gmail.com>.
First let me say that you did a great job of providing enough
information to diagnose! We're always more inclined to take time when
someone gives evidence of having already tried to solve the problem,
then provides enough information to work with....

Your problem is, I think, WordDelimiterGraphFilterFactory (WDGFF) ,
particularly that you have splitOnCaseChange set to "1" at index time
and "0" at query time, and your input is iPhone.

Try entering (note capitalization)
iPhone
in your admin/analysis for both indexing and querying and you'll see
what I mean. BTW, unchecking "verbose" often makes the output easier
to read...


I suspect you may have the same issue with your straight n-grammed
field, but are matching on sub-parts of the query.

Best,
Erick


On Mon, Jan 1, 2018 at 3:25 AM, Sami al Subhi <sa...@alsubhi.me> wrote:
> data_to_be_indexed.xml
> <http://lucene.472066.n3.nabble.com/file/t493675/data_to_be_indexed.xml>
> schema.xml <http://lucene.472066.n3.nabble.com/file/t493675/schema.xml>
>
> *above I uploaded a copy of my schema and data*
>
> *I have this in my schema.xml*
>
>     <field name="name_suggest_edge" type="text_suggest_edge" indexed="true"
> stored="true" multiValued="true"/>
>
>     <copyField source="name_ar" dest="name_suggest_edge" maxChars="30000" />
>     <copyField source="name_en" dest="name_suggest_edge" maxChars="30000" />
>
>     <fieldType name="text_suggest_edge" class="solr.TextField">
>           <analyzer type="index">
>             <tokenizer class="solr.StandardTokenizerFactory"/>
>             <filter class="solr.WordDelimiterGraphFilterFactory"
> generateWordParts="1" generateNumberParts="1" catenateWords="0"
> catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
>             <filter class="solr.LowerCaseFilterFactory"/>
>             <filter class="solr.ArabicNormalizationFilterFactory"/>
>             <filter class="solr.EdgeNGramFilterFactory" maxGramSize="20"
> minGramSize="1"/>
>           </analyzer>
>           <analyzer type="query">
>             <tokenizer class="solr.StandardTokenizerFactory"/>
>             <filter class="solr.WordDelimiterGraphFilterFactory"
> generateWordParts="0" generateNumberParts="0" catenateWords="0"
> catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
>             <filter class="solr.LowerCaseFilterFactory"/>
>             <filter class="solr.ArabicNormalizationFilterFactory"/>
>           </analyzer>
>     </fieldType>
>
> *when using analysis on admin page it works and it does match as you can see
> from the picture below:*
>
> <http://lucene.472066.n3.nabble.com/file/t493675/solr_analysis.png>
>
>
> *I have this doc in indexed/stored. I can match it on other fields like
> name_suggest_exact or name_sugget_ngram but never matches on
> name_sugget_edge. I indexed the data multiple times and index is optimized.
> what could be the issue here? this is really confusing*
>
> <http://lucene.472066.n3.nabble.com/file/t493675/name_exact.png>
> <http://lucene.472066.n3.nabble.com/file/t493675/edge.png>
>
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html