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 Karl Kildén <ka...@gmail.com> on 2015/06/23 12:41:15 UTC

Question regarding getting back results from middle of word

Hello!

if I have a field like "onetwothreefour" I want users to find that document
with a query for "two". This seems to work when I use

                        <filter class="solr.ReverseStringFilterFactory"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="3"
maxGramSize="25" />
<filter class="solr.ReverseStringFilterFactory"/>

I got that one off google. The problem is I really want a search for "one"
to be regarded as a better hit but seems the fragments created are like an
equal word, or am I missing something? I also don't want those fragments to
be a part of the spelling index...

Feels like I am missing something on how to best configure wildcards in a
word yet not affecting my index.

Cheers

Re: Question regarding getting back results from middle of word

Posted by Alessandro Benedetti <be...@gmail.com>.
It sounds the classic XY problem , can you explain us a little bit better
your problem ?
Why you have such strange field content, how do you produce it ?
Can this be solved with an analysis ad hoc for your language ?

It sounds to me as a tokenization problem, and you are not going to solve
it using edge grams …

Please give us more details,

Cheers

2015-06-23 11:41 GMT+01:00 Karl Kildén <ka...@gmail.com>:

> Hello!
>
> if I have a field like "onetwothreefour" I want users to find that document
> with a query for "two". This seems to work when I use
>
>                         <filter class="solr.ReverseStringFilterFactory"/>
> <filter class="solr.EdgeNGramFilterFactory" minGramSize="3"
> maxGramSize="25" />
> <filter class="solr.ReverseStringFilterFactory"/>
>
> I got that one off google. The problem is I really want a search for "one"
> to be regarded as a better hit but seems the fragments created are like an
> equal word, or am I missing something? I also don't want those fragments to
> be a part of the spelling index...
>
> Feels like I am missing something on how to best configure wildcards in a
> word yet not affecting my index.
>
> Cheers
>



-- 
--------------------------

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England