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 Chien Nguyen <ch...@gmail.com> on 2017/05/26 07:19:34 UTC

Solr uppercase inside phrase query

Hi, everyone!
I'm getting trouble with query data from solr. When i query with key "iPhone
Se" it shows results, key "iPhone se" same, but i query "iphone se", there
is no result. I used LowerCaseFilterFactory in both index and query analyzer
. What's wrong with my schema? please let me see. Thank so much!
Here my schema with field search:

<fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
	
		
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
	<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
generateNumberParts="1" catenateWords="1" catenateNumbers="1"
catenateAll="0" splitOnCaseChange="1"/>
        
        <filter class="solr.LowerCaseFilterFactory"/>
	<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
	<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
	<filter class="solr.ICUFoldingFilterFactory"/>
     </analyzer>
     <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
	

        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
	<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
generateNumberParts="1 catenateWords="0" catenateNumbers="0" catenateAll="0"
splitOnCaseChange="1"/>

        <filter class="solr.LowerCaseFilterFactory"/>
	<filter class="solr.ICUFoldingFilterFactory"/>
	<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-uppercase-inside-phrase-query-tp4337403.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr uppercase inside phrase query

Posted by Chien Nguyen <ch...@gmail.com>.
Many thank. I will try it 



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-uppercase-inside-phrase-query-tp4337403p4337786.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr uppercase inside phrase query

Posted by arobinski <ar...@olx.pl>.
Did you manage to solve the problem? I have the same problem and would like
to know a solution.


Chien Nguyen wrote
> Many thank. I will try it.





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

Re: Solr uppercase inside phrase query

Posted by Chien Nguyen <ch...@gmail.com>.
Many thank. I will try it. 



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-uppercase-inside-phrase-query-tp4337403p4337787.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr uppercase inside phrase query

Posted by Erick Erickson <er...@gmail.com>.
WordDelimiterFilterFactory is probably your issue, but it _should_ be
working in the exact example you gave. Did you by chance
change _anything_ without re-indexing? Susheel's comment about
looking at the analysis page is an excellent one.

Also add &debug=query and insure that you're searching against the
field you think you are think you are.

Best,
Erick

On Fri, May 26, 2017 at 6:26 AM, Susheel Kumar <su...@gmail.com> wrote:
> I mean splitOnCaseChange.
>
> On Fri, May 26, 2017 at 9:26 AM, Susheel Kumar <su...@gmail.com>
> wrote:
>
>> Make generateWordParts to 0 and see your self in the Analysis tab the
>> results...
>>
>> On Fri, May 26, 2017 at 3:19 AM, Chien Nguyen <ch...@gmail.com>
>> wrote:
>>
>>> Hi, everyone!
>>> I'm getting trouble with query data from solr. When i query with key
>>> "iPhone
>>> Se" it shows results, key "iPhone se" same, but i query "iphone se", there
>>> is no result. I used LowerCaseFilterFactory in both index and query
>>> analyzer
>>> . What's wrong with my schema? please let me see. Thank so much!
>>> Here my schema with field search:
>>>
>>> <fieldType name="text_general" class="solr.TextField"
>>> positionIncrementGap="100">
>>>       <analyzer type="index">
>>>         <tokenizer class="solr.StandardTokenizerFactory"/>
>>>
>>>
>>>         <filter class="solr.StopFilterFactory" ignoreCase="true"
>>> words="stopwords.txt"/>
>>>         <filter class="solr.WordDelimiterFilterFactory"
>>> generateWordParts="1"
>>> generateNumberParts="1" catenateWords="1" catenateNumbers="1"
>>> catenateAll="0" splitOnCaseChange="1"/>
>>>
>>>         <filter class="solr.LowerCaseFilterFactory"/>
>>>         <filter class="solr.KeywordMarkerFilterFactory"
>>> protected="protwords.txt"/>
>>>         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>>>         <filter class="solr.ICUFoldingFilterFactory"/>
>>>      </analyzer>
>>>      <analyzer type="query">
>>>         <tokenizer class="solr.StandardTokenizerFactory"/>
>>>
>>>
>>>         <filter class="solr.StopFilterFactory" ignoreCase="true"
>>> words="stopwords.txt"/>
>>>         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
>>> ignoreCase="true" expand="true"/>
>>>         <filter class="solr.WordDelimiterFilterFactory"
>>> generateWordParts="1"
>>> generateNumberParts="1 catenateWords="0" catenateNumbers="0"
>>> catenateAll="0"
>>> splitOnCaseChange="1"/>
>>>
>>>         <filter class="solr.LowerCaseFilterFactory"/>
>>>         <filter class="solr.ICUFoldingFilterFactory"/>
>>>         <filter class="solr.KeywordMarkerFilterFactory"
>>> protected="protwords.txt"/>
>>>         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>>>       </analyzer>
>>>     </fieldType>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://lucene.472066.n3.nabble
>>> .com/Solr-uppercase-inside-phrase-query-tp4337403.html
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>
>>

Re: Solr uppercase inside phrase query

Posted by Susheel Kumar <su...@gmail.com>.
I mean splitOnCaseChange.

On Fri, May 26, 2017 at 9:26 AM, Susheel Kumar <su...@gmail.com>
wrote:

> Make generateWordParts to 0 and see your self in the Analysis tab the
> results...
>
> On Fri, May 26, 2017 at 3:19 AM, Chien Nguyen <ch...@gmail.com>
> wrote:
>
>> Hi, everyone!
>> I'm getting trouble with query data from solr. When i query with key
>> "iPhone
>> Se" it shows results, key "iPhone se" same, but i query "iphone se", there
>> is no result. I used LowerCaseFilterFactory in both index and query
>> analyzer
>> . What's wrong with my schema? please let me see. Thank so much!
>> Here my schema with field search:
>>
>> <fieldType name="text_general" class="solr.TextField"
>> positionIncrementGap="100">
>>       <analyzer type="index">
>>         <tokenizer class="solr.StandardTokenizerFactory"/>
>>
>>
>>         <filter class="solr.StopFilterFactory" ignoreCase="true"
>> words="stopwords.txt"/>
>>         <filter class="solr.WordDelimiterFilterFactory"
>> generateWordParts="1"
>> generateNumberParts="1" catenateWords="1" catenateNumbers="1"
>> catenateAll="0" splitOnCaseChange="1"/>
>>
>>         <filter class="solr.LowerCaseFilterFactory"/>
>>         <filter class="solr.KeywordMarkerFilterFactory"
>> protected="protwords.txt"/>
>>         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>>         <filter class="solr.ICUFoldingFilterFactory"/>
>>      </analyzer>
>>      <analyzer type="query">
>>         <tokenizer class="solr.StandardTokenizerFactory"/>
>>
>>
>>         <filter class="solr.StopFilterFactory" ignoreCase="true"
>> words="stopwords.txt"/>
>>         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
>> ignoreCase="true" expand="true"/>
>>         <filter class="solr.WordDelimiterFilterFactory"
>> generateWordParts="1"
>> generateNumberParts="1 catenateWords="0" catenateNumbers="0"
>> catenateAll="0"
>> splitOnCaseChange="1"/>
>>
>>         <filter class="solr.LowerCaseFilterFactory"/>
>>         <filter class="solr.ICUFoldingFilterFactory"/>
>>         <filter class="solr.KeywordMarkerFilterFactory"
>> protected="protwords.txt"/>
>>         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>>       </analyzer>
>>     </fieldType>
>>
>>
>>
>> --
>> View this message in context: http://lucene.472066.n3.nabble
>> .com/Solr-uppercase-inside-phrase-query-tp4337403.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>
>

Re: Solr uppercase inside phrase query

Posted by Susheel Kumar <su...@gmail.com>.
Make generateWordParts to 0 and see your self in the Analysis tab the
results...

On Fri, May 26, 2017 at 3:19 AM, Chien Nguyen <ch...@gmail.com> wrote:

> Hi, everyone!
> I'm getting trouble with query data from solr. When i query with key
> "iPhone
> Se" it shows results, key "iPhone se" same, but i query "iphone se", there
> is no result. I used LowerCaseFilterFactory in both index and query
> analyzer
> . What's wrong with my schema? please let me see. Thank so much!
> Here my schema with field search:
>
> <fieldType name="text_general" class="solr.TextField"
> positionIncrementGap="100">
>       <analyzer type="index">
>         <tokenizer class="solr.StandardTokenizerFactory"/>
>
>
>         <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
>         <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="1"
> generateNumberParts="1" catenateWords="1" catenateNumbers="1"
> catenateAll="0" splitOnCaseChange="1"/>
>
>         <filter class="solr.LowerCaseFilterFactory"/>
>         <filter class="solr.KeywordMarkerFilterFactory"
> protected="protwords.txt"/>
>         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>         <filter class="solr.ICUFoldingFilterFactory"/>
>      </analyzer>
>      <analyzer type="query">
>         <tokenizer class="solr.StandardTokenizerFactory"/>
>
>
>         <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
>         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
>         <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="1"
> generateNumberParts="1 catenateWords="0" catenateNumbers="0"
> catenateAll="0"
> splitOnCaseChange="1"/>
>
>         <filter class="solr.LowerCaseFilterFactory"/>
>         <filter class="solr.ICUFoldingFilterFactory"/>
>         <filter class="solr.KeywordMarkerFilterFactory"
> protected="protwords.txt"/>
>         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>       </analyzer>
>     </fieldType>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Solr-uppercase-inside-phrase-query-tp4337403.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>