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 Kissue Kissue <ki...@gmail.com> on 2012/10/10 14:15:49 UTC
Wild card searching - well sort of
Hi,
I am wondering if there is a way i can get Solr to do this:
I have added the string: *-BAAN-* to the index to a field called pattern
which is a string type. Now i want to be able to search for A100-BAAN-C20
or ZA20-BAAN-300 and have Solr return *-BAAN-*.
Any ideas how i can accomplish something like this? I am currently using
Solr 3.5 with solrJ.
Thanks.
Re: Wild card searching - well sort of
Posted by Jack Krupansky <ja...@basetechnology.com>.
1. What is your specific motivation for wanting to do this? (Sounds like yet
another "XY problem"!)
2. What specific rules are you expecting to use for synthesis of patterns
from the raw data?
For the latter, do you expect to index hand-coded specific patterns to be
returned or do you have some sort of "machine learning" method in mind that
will generate the patterns by examining all of the values?
-- Jack Krupansky
-----Original Message-----
From: Kissue Kissue
Sent: Wednesday, October 10, 2012 8:15 AM
To: solr-user@lucene.apache.org
Subject: Wild card searching - well sort of
Hi,
I am wondering if there is a way i can get Solr to do this:
I have added the string: *-BAAN-* to the index to a field called pattern
which is a string type. Now i want to be able to search for A100-BAAN-C20
or ZA20-BAAN-300 and have Solr return *-BAAN-*.
Any ideas how i can accomplish something like this? I am currently using
Solr 3.5 with solrJ.
Thanks.
Re: Wild card searching - well sort of
Posted by Erick Erickson <er...@gmail.com>.
Have you looked at WordDelimiterFilterFactory that was mentioned
earlier? Try a fieldType in the admin/analysis page that has
WDFF as part of the analysis chain. It would do exactly what you've
described so far.
WDFF splits the input up as tokens on non-alphanum characters,
alpha/num transitions and case transitions (you can configure these).
Then searching will match these split-out tokens.
Best
Erick
On Wed, Oct 10, 2012 at 10:28 AM, Kissue Kissue <ki...@gmail.com> wrote:
> It is really not fixed. It could also be *-*-BAAN or BAAN-CAN20-*. In each
> i just want only the fixed character(s) to match then the * can match any
> character.
>
>
> On Wed, Oct 10, 2012 at 2:05 PM, Toke Eskildsen <te...@statsbiblioteket.dk>wrote:
>
>> On Wed, 2012-10-10 at 14:15 +0200, Kissue Kissue wrote:
>> > I have added the string: *-BAAN-* to the index to a field called pattern
>> > which is a string type. Now i want to be able to search for A100-BAAN-C20
>> > or ZA20-BAAN-300 and have Solr return *-BAAN-*.
>>
>> That sounds a lot like the problem presented in the thread
>> "Indexing wildcard patterns":
>> http://web.archiveorange.com/archive/v/AAfXfcuIJY9BQJL3mjty
>>
>> The short answer is no, Solr does not support this in the general form.
>> But maybe you can make it work anyway. In your example, the two queries
>> A100-BAAN-C20 and ZA20-BAAN-300 share the form
>> [4 random characters]-[4 significant characters]-[3 random characters]
>> so a little bit of pre-processing would rewrite that to
>> *-[4 significant characters]-*
>> which would match *-BAAN-*
>>
>> If you describe the patterns and common elements to your indexed terms
>> and to your queries, we might come up with something.
>>
>>
Re: Wild card searching - well sort of
Posted by Kissue Kissue <ki...@gmail.com>.
It is really not fixed. It could also be *-*-BAAN or BAAN-CAN20-*. In each
i just want only the fixed character(s) to match then the * can match any
character.
On Wed, Oct 10, 2012 at 2:05 PM, Toke Eskildsen <te...@statsbiblioteket.dk>wrote:
> On Wed, 2012-10-10 at 14:15 +0200, Kissue Kissue wrote:
> > I have added the string: *-BAAN-* to the index to a field called pattern
> > which is a string type. Now i want to be able to search for A100-BAAN-C20
> > or ZA20-BAAN-300 and have Solr return *-BAAN-*.
>
> That sounds a lot like the problem presented in the thread
> "Indexing wildcard patterns":
> http://web.archiveorange.com/archive/v/AAfXfcuIJY9BQJL3mjty
>
> The short answer is no, Solr does not support this in the general form.
> But maybe you can make it work anyway. In your example, the two queries
> A100-BAAN-C20 and ZA20-BAAN-300 share the form
> [4 random characters]-[4 significant characters]-[3 random characters]
> so a little bit of pre-processing would rewrite that to
> *-[4 significant characters]-*
> which would match *-BAAN-*
>
> If you describe the patterns and common elements to your indexed terms
> and to your queries, we might come up with something.
>
>
Re: Wild card searching - well sort of
Posted by Toke Eskildsen <te...@statsbiblioteket.dk>.
On Wed, 2012-10-10 at 14:15 +0200, Kissue Kissue wrote:
> I have added the string: *-BAAN-* to the index to a field called pattern
> which is a string type. Now i want to be able to search for A100-BAAN-C20
> or ZA20-BAAN-300 and have Solr return *-BAAN-*.
That sounds a lot like the problem presented in the thread
"Indexing wildcard patterns":
http://web.archiveorange.com/archive/v/AAfXfcuIJY9BQJL3mjty
The short answer is no, Solr does not support this in the general form.
But maybe you can make it work anyway. In your example, the two queries
A100-BAAN-C20 and ZA20-BAAN-300 share the form
[4 random characters]-[4 significant characters]-[3 random characters]
so a little bit of pre-processing would rewrite that to
*-[4 significant characters]-*
which would match *-BAAN-*
If you describe the patterns and common elements to your indexed terms
and to your queries, we might come up with something.
RE: Wild card searching - well sort of
Posted by Markus Jelsma <ma...@openindex.io>.
Hi - The WordDelimiterFilter can help you get *-BAAN-* for A100-BAAN-C20 but only because BAAN is surrounded with characters the filter splits and combines upon.
-----Original message-----
> From:Kissue Kissue <ki...@gmail.com>
> Sent: Wed 10-Oct-2012 14:20
> To: solr-user@lucene.apache.org
> Subject: Wild card searching - well sort of
>
> Hi,
>
> I am wondering if there is a way i can get Solr to do this:
>
> I have added the string: *-BAAN-* to the index to a field called pattern
> which is a string type. Now i want to be able to search for A100-BAAN-C20
> or ZA20-BAAN-300 and have Solr return *-BAAN-*.
>
> Any ideas how i can accomplish something like this? I am currently using
> Solr 3.5 with solrJ.
>
> Thanks.
>