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 ASHOK SARMAH <as...@gmail.com> on 2014/12/01 15:46:47 UTC

Contextual search

Hii all .i wanted to know how solr performs contextual search.actually in
my search list i had given the query as "three book".i got the suggestn as
"a book of three".which i wanted.but when i specify it as "thri book".it
specifies me of spelling check for thri as three its fyn.but why i dont get
in this case result as "a book of three".like previous.

Re: Contextual search

Posted by ASHOK SARMAH <as...@gmail.com>.
HI Alex,

I have specified following in my solrconfig.xml ::

 <str name="spellcheck">on</str>
       <str name="spellcheck.extendedResults">true</str>
       <str name="spellcheck.count">5</str>
       <str name="spellcheck.alternativeTermCount">2</str>
       <str name="spellcheck.maxResultsForSuggest">5</str>
       <str name="spellcheck.collate">true</str>
       <str name="spellcheck.collateExtendedResults">true</str>
       <str name="spellcheck.maxCollationTries">5</str>
       <str name="spellcheck.maxCollations">3</str>
<str name="spellcheck.dictionary">wordbreak</str>
<str name="spellcheck.MinBreakWordLength">5</str>


I have written <str name="spellcheck.dictionary">wordbreak</str>
<str name="spellcheck.MinBreakWordLength">5</str>   to break the words with
minimum length 5.then it should break my word threebook as three and book
right?correct me if I am wrong.But I am not getting the required search
results.Kindly suggest.

On Wed, Dec 3, 2014 at 12:08 AM, Alexandre Rafalovitch <ar...@gmail.com>
wrote:

> Well, how would you expect it to solve it - in non-technical terms.
> What's the high level description of "book of three" matching
> "threebook" and not say "threeof"? Random permutation of any two
> words? It's a bit of a strange requirement so far.
>
> Regards,
>    Alex.
> Personal: http://www.outerthoughts.com/ and @arafalov
> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>
>
> On 2 December 2014 at 12:55, ASHOK SARMAH <as...@gmail.com>
> wrote:
> > Hi alex thnx .i was able to get the get the suggestion for thri book as "
> > the book of three".but when i search for threebook (three and book are
> now
> > combined)then i am not able to get the suggestn for "a book of three".how
> > we solve this?
> > On 01-Dec-2014 9:34 PM, "Alexandre Rafalovitch" <ar...@gmail.com>
> wrote:
> >
> >> If you need Solr to treat 'thri' (invalid English) as 'three', you
> >> need to tell it to do so. Look at the synonym modules in the example's
> >> schema.xml.
> >>
> >> Or you could do phonetic matches. You have a couple of choices for
> >> those, but basically it's all about the specific analyzer chains to
> >> experiment with. So, start with that and come back if you still have
> >> troubles once you understand the way analyzers work.
> >>
> >> Regards,
> >>    Alex.
> >> Personal: http://www.outerthoughts.com/ and @arafalov
> >> Solr resources and newsletter: http://www.solr-start.com/ and
> @solrstart
> >> Solr popularizers community:
> https://www.linkedin.com/groups?gid=6713853
> >>
> >>
> >> On 1 December 2014 at 09:46, ASHOK SARMAH <as...@gmail.com>
> >> wrote:
> >> > Hii all .i wanted to know how solr performs contextual
> search.actually in
> >> > my search list i had given the query as "three book".i got the
> suggestn
> >> as
> >> > "a book of three".which i wanted.but when i specify it as "thri
> book".it
> >> > specifies me of spelling check for thri as three its fyn.but why i
> dont
> >> get
> >> > in this case result as "a book of three".like previous.
> >>
>

Re: Contextual search

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Sorry, beyond my area of expertise now. Hopefully somebody else will pitch in.

Regards,
   Alex.

Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 2 December 2014 at 22:03, ASHOK SARMAH <as...@gmail.com> wrote:
> HI Alex,
>
> I have specified these in the solrconfig.xml as::
>
> <str name="spellcheck">on</str>
>        <str name="spellcheck.extendedResults">true</str>
>        <str name="spellcheck.count">5</str>
>        <str name="spellcheck.alternativeTermCount">2</str>
>        <str name="spellcheck.maxResultsForSuggest">5</str>
>        <str name="spellcheck.collate">true</str>
>        <str name="spellcheck.collateExtendedResults">true</str>
>        <str name="spellcheck.maxCollationTries">5</str>
>        <str name="spellcheck.maxCollations">3</str>
> <str name="spellcheck.dictionary">wordbreak</str>
> <str name="spellcheck.MinBreakWordLength">5</str> .
>
>
>
> The lines  <str name="spellcheck.dictionary">wordbreak</str>
> <str name="spellcheck.MinBreakWordLength">5</str>  are for breaking the
> word threebook as three and book .But then too its not searching for the
> string "A book of three".Kindly suggest what all ways it can be done
>
> On Wed, Dec 3, 2014 at 12:08 AM, Alexandre Rafalovitch <ar...@gmail.com>
> wrote:
>
>> Well, how would you expect it to solve it - in non-technical terms.
>> What's the high level description of "book of three" matching
>> "threebook" and not say "threeof"? Random permutation of any two
>> words? It's a bit of a strange requirement so far.
>>
>> Regards,
>>    Alex.
>> Personal: http://www.outerthoughts.com/ and @arafalov
>> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
>> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>>
>>
>> On 2 December 2014 at 12:55, ASHOK SARMAH <as...@gmail.com>
>> wrote:
>> > Hi alex thnx .i was able to get the get the suggestion for thri book as "
>> > the book of three".but when i search for threebook (three and book are
>> now
>> > combined)then i am not able to get the suggestn for "a book of three".how
>> > we solve this?
>> > On 01-Dec-2014 9:34 PM, "Alexandre Rafalovitch" <ar...@gmail.com>
>> wrote:
>> >
>> >> If you need Solr to treat 'thri' (invalid English) as 'three', you
>> >> need to tell it to do so. Look at the synonym modules in the example's
>> >> schema.xml.
>> >>
>> >> Or you could do phonetic matches. You have a couple of choices for
>> >> those, but basically it's all about the specific analyzer chains to
>> >> experiment with. So, start with that and come back if you still have
>> >> troubles once you understand the way analyzers work.
>> >>
>> >> Regards,
>> >>    Alex.
>> >> Personal: http://www.outerthoughts.com/ and @arafalov
>> >> Solr resources and newsletter: http://www.solr-start.com/ and
>> @solrstart
>> >> Solr popularizers community:
>> https://www.linkedin.com/groups?gid=6713853
>> >>
>> >>
>> >> On 1 December 2014 at 09:46, ASHOK SARMAH <as...@gmail.com>
>> >> wrote:
>> >> > Hii all .i wanted to know how solr performs contextual
>> search.actually in
>> >> > my search list i had given the query as "three book".i got the
>> suggestn
>> >> as
>> >> > "a book of three".which i wanted.but when i specify it as "thri
>> book".it
>> >> > specifies me of spelling check for thri as three its fyn.but why i
>> dont
>> >> get
>> >> > in this case result as "a book of three".like previous.
>> >>
>>

Re: Contextual search

Posted by ASHOK SARMAH <as...@gmail.com>.
HI Alex,

I have specified these in the solrconfig.xml as::

<str name="spellcheck">on</str>
       <str name="spellcheck.extendedResults">true</str>
       <str name="spellcheck.count">5</str>
       <str name="spellcheck.alternativeTermCount">2</str>
       <str name="spellcheck.maxResultsForSuggest">5</str>
       <str name="spellcheck.collate">true</str>
       <str name="spellcheck.collateExtendedResults">true</str>
       <str name="spellcheck.maxCollationTries">5</str>
       <str name="spellcheck.maxCollations">3</str>
<str name="spellcheck.dictionary">wordbreak</str>
<str name="spellcheck.MinBreakWordLength">5</str> .



The lines  <str name="spellcheck.dictionary">wordbreak</str>
<str name="spellcheck.MinBreakWordLength">5</str>  are for breaking the
word threebook as three and book .But then too its not searching for the
string "A book of three".Kindly suggest what all ways it can be done

On Wed, Dec 3, 2014 at 12:08 AM, Alexandre Rafalovitch <ar...@gmail.com>
wrote:

> Well, how would you expect it to solve it - in non-technical terms.
> What's the high level description of "book of three" matching
> "threebook" and not say "threeof"? Random permutation of any two
> words? It's a bit of a strange requirement so far.
>
> Regards,
>    Alex.
> Personal: http://www.outerthoughts.com/ and @arafalov
> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>
>
> On 2 December 2014 at 12:55, ASHOK SARMAH <as...@gmail.com>
> wrote:
> > Hi alex thnx .i was able to get the get the suggestion for thri book as "
> > the book of three".but when i search for threebook (three and book are
> now
> > combined)then i am not able to get the suggestn for "a book of three".how
> > we solve this?
> > On 01-Dec-2014 9:34 PM, "Alexandre Rafalovitch" <ar...@gmail.com>
> wrote:
> >
> >> If you need Solr to treat 'thri' (invalid English) as 'three', you
> >> need to tell it to do so. Look at the synonym modules in the example's
> >> schema.xml.
> >>
> >> Or you could do phonetic matches. You have a couple of choices for
> >> those, but basically it's all about the specific analyzer chains to
> >> experiment with. So, start with that and come back if you still have
> >> troubles once you understand the way analyzers work.
> >>
> >> Regards,
> >>    Alex.
> >> Personal: http://www.outerthoughts.com/ and @arafalov
> >> Solr resources and newsletter: http://www.solr-start.com/ and
> @solrstart
> >> Solr popularizers community:
> https://www.linkedin.com/groups?gid=6713853
> >>
> >>
> >> On 1 December 2014 at 09:46, ASHOK SARMAH <as...@gmail.com>
> >> wrote:
> >> > Hii all .i wanted to know how solr performs contextual
> search.actually in
> >> > my search list i had given the query as "three book".i got the
> suggestn
> >> as
> >> > "a book of three".which i wanted.but when i specify it as "thri
> book".it
> >> > specifies me of spelling check for thri as three its fyn.but why i
> dont
> >> get
> >> > in this case result as "a book of three".like previous.
> >>
>

Re: Contextual search

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Well, how would you expect it to solve it - in non-technical terms.
What's the high level description of "book of three" matching
"threebook" and not say "threeof"? Random permutation of any two
words? It's a bit of a strange requirement so far.

Regards,
   Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 2 December 2014 at 12:55, ASHOK SARMAH <as...@gmail.com> wrote:
> Hi alex thnx .i was able to get the get the suggestion for thri book as "
> the book of three".but when i search for threebook (three and book are now
> combined)then i am not able to get the suggestn for "a book of three".how
> we solve this?
> On 01-Dec-2014 9:34 PM, "Alexandre Rafalovitch" <ar...@gmail.com> wrote:
>
>> If you need Solr to treat 'thri' (invalid English) as 'three', you
>> need to tell it to do so. Look at the synonym modules in the example's
>> schema.xml.
>>
>> Or you could do phonetic matches. You have a couple of choices for
>> those, but basically it's all about the specific analyzer chains to
>> experiment with. So, start with that and come back if you still have
>> troubles once you understand the way analyzers work.
>>
>> Regards,
>>    Alex.
>> Personal: http://www.outerthoughts.com/ and @arafalov
>> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
>> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>>
>>
>> On 1 December 2014 at 09:46, ASHOK SARMAH <as...@gmail.com>
>> wrote:
>> > Hii all .i wanted to know how solr performs contextual search.actually in
>> > my search list i had given the query as "three book".i got the suggestn
>> as
>> > "a book of three".which i wanted.but when i specify it as "thri book".it
>> > specifies me of spelling check for thri as three its fyn.but why i dont
>> get
>> > in this case result as "a book of three".like previous.
>>

Re: Contextual search

Posted by ASHOK SARMAH <as...@gmail.com>.
Hi alex thnx .i was able to get the get the suggestion for thri book as "
the book of three".but when i search for threebook (three and book are now
combined)then i am not able to get the suggestn for "a book of three".how
we solve this?
On 01-Dec-2014 9:34 PM, "Alexandre Rafalovitch" <ar...@gmail.com> wrote:

> If you need Solr to treat 'thri' (invalid English) as 'three', you
> need to tell it to do so. Look at the synonym modules in the example's
> schema.xml.
>
> Or you could do phonetic matches. You have a couple of choices for
> those, but basically it's all about the specific analyzer chains to
> experiment with. So, start with that and come back if you still have
> troubles once you understand the way analyzers work.
>
> Regards,
>    Alex.
> Personal: http://www.outerthoughts.com/ and @arafalov
> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>
>
> On 1 December 2014 at 09:46, ASHOK SARMAH <as...@gmail.com>
> wrote:
> > Hii all .i wanted to know how solr performs contextual search.actually in
> > my search list i had given the query as "three book".i got the suggestn
> as
> > "a book of three".which i wanted.but when i specify it as "thri book".it
> > specifies me of spelling check for thri as three its fyn.but why i dont
> get
> > in this case result as "a book of three".like previous.
>

Re: Contextual search

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
If you need Solr to treat 'thri' (invalid English) as 'three', you
need to tell it to do so. Look at the synonym modules in the example's
schema.xml.

Or you could do phonetic matches. You have a couple of choices for
those, but basically it's all about the specific analyzer chains to
experiment with. So, start with that and come back if you still have
troubles once you understand the way analyzers work.

Regards,
   Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 1 December 2014 at 09:46, ASHOK SARMAH <as...@gmail.com> wrote:
> Hii all .i wanted to know how solr performs contextual search.actually in
> my search list i had given the query as "three book".i got the suggestn as
> "a book of three".which i wanted.but when i specify it as "thri book".it
> specifies me of spelling check for thri as three its fyn.but why i dont get
> in this case result as "a book of three".like previous.

Re: Contextual search

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Doesn't it seem like WordBreakSolrSpellChecker mentioned at
http://wiki.apache.org/solr/SpellCheckComponent?

On Mon, Dec 1, 2014 at 5:46 PM, ASHOK SARMAH <as...@gmail.com>
wrote:

> Hii all .i wanted to know how solr performs contextual search.actually in
> my search list i had given the query as "three book".i got the suggestn as
> "a book of three".which i wanted.but when i specify it as "thri book".it
> specifies me of spelling check for thri as three its fyn.but why i dont get
> in this case result as "a book of three".like previous.
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>