Hi Emir,

I got it. Thanks Emir it was helpful

Thanks
Rajesh



Corporate Executive Board India Private Limited. Registration No: 
U741040HR2004PTC035324. Registered office: 6th Floor, Tower B, DLF Building 
No.10 DLF Cyber City, Gurgaon, Haryana-122002, India.

This e-mail and/or its attachments are intended only for the use of the 
addressee(s) and may contain confidential and legally privileged information 
belonging to CEB and/or its subsidiaries, including CEB subsidiaries that offer 
SHL Talent Measurement products and services. If you have received this e-mail 
in error, please notify the sender and immediately, destroy all copies of this 
email and its attachments. The publication, copying, in whole or in part, or 
use or dissemination in any other way of this e-mail and attachments by anyone 
other than the intended person(s) is prohibited.

-----Original Message-----
From: Emir Arnautovic [mailto:emir.arnauto...@sematext.com]
Sent: Monday, March 7, 2016 8:16 PM
To: solr-user@lucene.apache.org
Subject: Re: Text search NGram

Not sure I understood question. What I meant is you to try setting 
omitNorms="false" to your txt_token field type if you want to stick with ngram 
only solution:

<fieldType name="txt_token" class="solr.TextField" positionIncrementGap="0" 
omitNorms="false">
                 <analyzer type="index">
                                 <charFilter 
class="solr.PatternReplaceCharFilterFactory" pattern="\s+" replacement=" "/>
                                 <tokenizer 
class="solr.WhitespaceTokenizerFactory"/>
                                 <filter class="solr.LowerCaseFilterFactory"/>
                                 <filter class="solr.NGramFilterFactory" 
minGramSize="2" maxGramSize="800"/>
                 </analyzer>
                  <analyzer type="query">
                                 <charFilter 
class="solr.PatternReplaceCharFilterFactory" pattern="\s+" replacement=" "/>
                                 <tokenizer 
class="solr.WhitespaceTokenizerFactory"/>
                                 <filter class="solr.LowerCaseFilterFactory"/>
                                 <filter class="solr.NGramFilterFactory" 
minGramSize="2" maxGramSize="800"/>
                 </analyzer>
   </fieldType>


and to add new field type and field to keep nonngram version of field.
Something like:

<fieldType name="txt_token_simple" class="solr.TextField" 
positionIncrementGap="0" >
                 <analyzer type="index">
                                 <charFilter 
class="solr.PatternReplaceCharFilterFactory" pattern="\s+" replacement=" "/>
                                 <tokenizer 
class="solr.WhitespaceTokenizerFactory"/>
                                 <filter class="solr.LowerCaseFilterFactory"/>
                 </analyzer>
                  <analyzer type="query">
                                 <charFilter 
class="solr.PatternReplaceCharFilterFactory" pattern="\s+" replacement=" "/>
                                 <tokenizer 
class="solr.WhitespaceTokenizerFactory"/>
                                 <filter class="solr.LowerCaseFilterFactory"/>
                 </analyzer>
   </fieldType>


and use copyField to copy to both fields and query title:test OR 
title_simple:test.

Emir


On 07.03.2016 15:31, G, Rajesh wrote:
> Hi Emir,
>
> I have already applied
>
> <tokenizer class="solr.WhitespaceTokenizerFactory"/> and then I have applied 
> <filter class="solr.NGramFilterFactory" minGramSize="2" maxGramSize="800"/>. 
> Is this what you wanted me to have in my config?
>
> Thanks
> Rajesh
>
>
>
> Corporate Executive Board India Private Limited. Registration No: 
> U741040HR2004PTC035324. Registered office: 6th Floor, Tower B, DLF Building 
> No.10 DLF Cyber City, Gurgaon, Haryana-122002, India.
>
> This e-mail and/or its attachments are intended only for the use of the 
> addressee(s) and may contain confidential and legally privileged information 
> belonging to CEB and/or its subsidiaries, including CEB subsidiaries that 
> offer SHL Talent Measurement products and services. If you have received this 
> e-mail in error, please notify the sender and immediately, destroy all copies 
> of this email and its attachments. The publication, copying, in whole or in 
> part, or use or dissemination in any other way of this e-mail and attachments 
> by anyone other than the intended person(s) is prohibited.
>
> -----Original Message-----
> From: G, Rajesh [mailto:r...@cebglobal.com]
> Sent: Monday, March 7, 2016 7:50 PM
> To: solr-user@lucene.apache.org
> Subject: RE: Text search NGram
>
> Hi Emir,
>
> Thanks for you email. Can you please help me to understand what do you mean 
> by "e.g. boost if matching tokenized fileds to make sure exact matches are 
> ordered first"
>
>
>
> Corporate Executive Board India Private Limited. Registration No: 
> U741040HR2004PTC035324. Registered office: 6th Floor, Tower B, DLF Building 
> No.10 DLF Cyber City, Gurgaon, Haryana-122002, India.
>
> This e-mail and/or its attachments are intended only for the use of the 
> addressee(s) and may contain confidential and legally privileged information 
> belonging to CEB and/or its subsidiaries, including CEB subsidiaries that 
> offer SHL Talent Measurement products and services. If you have received this 
> e-mail in error, please notify the sender and immediately, destroy all copies 
> of this email and its attachments. The publication, copying, in whole or in 
> part, or use or dissemination in any other way of this e-mail and attachments 
> by anyone other than the intended person(s) is prohibited.
>
> -----Original Message-----
> From: Emir Arnautovic [mailto:emir.arnauto...@sematext.com]
> Sent: Monday, March 7, 2016 7:36 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Text search NGram
>
> Hi Rajesh,
> It is most likely related to norms - you can try setting omitNorms="true" and 
> reindexing content. Anyway, it is not common to use just ngrams for matching 
> content - in such case you can expect more unexpected ordering/results. You 
> should combine ngrams fields with normally tokenized fields (e.g. boost if 
> matching tokenized fileds to make sure exact matches are ordered first).
>
> Regards,
> Emir
>
> On 07.03.2016 11:44, G, Rajesh wrote:
>> Hi Team,
>>
>> We have the blow type and we have indexed the value  "title": "Microsoft 
>> Visual Studio 2006" and "title": "Microsoft Visual Studio 8.0.61205.56 
>> (2005)"
>>
>> When I search for title:(Microsoft Visual AND Studio AND 2005)  I get 
>> Microsoft Visual Studio 8.0.61205.56 (2005) as the second record and  
>> Microsoft Visual Studio 2006 as first record. I wanted to have Microsoft 
>> Visual Studio 8.0.61205.56 (2005) listed first since the user has searched 
>> for Microsoft Visual Studio 2005. Can you please help?.
>>
>> We are using NGram so it takes care of misspelled or jumbled words[it
>> works as expected] e.g.
>> searching Micrs Visual Studio will gets Microsoft Visual Studio
>> searching Visual Microsoft Studio will gets Microsoft Visual Studio
>>
>>     <fieldType name="txt_token" class="solr.TextField" 
>> positionIncrementGap="0" >
>>                   <analyzer type="index">
>>                                   <charFilter 
>> class="solr.PatternReplaceCharFilterFactory" pattern="\s+" replacement=" "/>
>>                                   <tokenizer 
>> class="solr.WhitespaceTokenizerFactory"/>
>>                                   <filter 
>> class="solr.LowerCaseFilterFactory"/>
>>                                   <filter class="solr.NGramFilterFactory" 
>> minGramSize="2" maxGramSize="800"/>
>>                   </analyzer>
>>                    <analyzer type="query">
>>                                   <charFilter 
>> class="solr.PatternReplaceCharFilterFactory" pattern="\s+" replacement=" "/>
>>                                   <tokenizer 
>> class="solr.WhitespaceTokenizerFactory"/>
>>                                   <filter 
>> class="solr.LowerCaseFilterFactory"/>
>>                                   <filter class="solr.NGramFilterFactory" 
>> minGramSize="2" maxGramSize="800"/>
>>                   </analyzer>
>>     </fieldType>
>>
>>
>>
>> Corporate Executive Board India Private Limited. Registration No: 
>> U741040HR2004PTC035324. Registered office: 6th Floor, Tower B, DLF Building 
>> No.10 DLF Cyber City, Gurgaon, Haryana-122002, India..
>>
>>
>>
>> This e-mail and/or its attachments are intended only for the use of the 
>> addressee(s) and may contain confidential and legally privileged information 
>> belonging to CEB and/or its subsidiaries, including CEB subsidiaries that 
>> offer SHL Talent Measurement products and services. If you have received 
>> this e-mail in error, please notify the sender and immediately, destroy all 
>> copies of this email and its attachments. The publication, copying, in whole 
>> or in part, or use or dissemination in any other way of this e-mail and 
>> attachments by anyone other than the intended person(s) is prohibited.
>>
>>
> --
> Monitoring * Alerting * Anomaly Detection * Centralized Log Management
> Solr & Elasticsearch Support * http://sematext.com/
>

--
Monitoring * Alerting * Anomaly Detection * Centralized Log Management Solr & 
Elasticsearch Support * http://sematext.com/

Reply via email to