Hi,
Thanks Otis, Newton and everyone else for the help on this issue.
Most of the data I index are documents like pdfs, word Docs, open office
documents, etc. I store the content of the document in a field called
content and the remaining metadata of the document like name, id,
created by, modified by, created on, etc in a copy field called
metadata. I am not particularly interested in enabling leading wildcard
characters in the content (although such a possibility would be a
bonus). For this, I've tried implementing the suggestion to store
reverse strings as well as the correct strings for the metadata field.
All leading wildcard queries like "*abc" and searched as "cba*" against
the reversed metadata field. So far so good. Thank you :)
But now, I ran into the scenario where the query string is *abc* :( and
the whole thing came down crashing again. I cannot ignore such queries.
I would rather take the risk of Solr OOMing by enabling the leading
wildcard query searches.
Can someone please tell me the steps to turn on this feature in Lucene
QueryParser? I am sure it will be helpful to many to document such a
procedure on the Wiki or somewhere else. (I am definitely going to do
that once I fix this. Too much trouble this seems to be)
Also, which queryParser does Solr use by default?
Thanks,
Kumar
-----Original Message-----
From: Otis Gospodnetic [mailto:***@yahoo.com]
Sent: Thursday, January 15, 2009 10:18 PM
To: solr-***@lucene.apache.org
Subject: Re: Customizing Solr to handle Leading Wildcard queries
Hi ramuK,
I believe you can turn that "on" via the Lucene QueryParser, but of
course such searches will be slo(oo)w. You can also index reversed
tokens (e.g. *kumar --> rakum*) or you could index n-grams with
begin/end delim characters (e.g. kumar -> ^ k u m a r $, *kumar -> "k u
m a r $")
Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
----- Original Message ----
Sent: Thursday, January 15, 2009 9:49:24 AM
Subject: RE: Customizing Solr to handle Leading Wildcard queries
Hi Erik,
Thanks for the quick reply.
I want to enable leading wildcard query searches in general. The case
mentioned in the earlier mail is just one of the many instances I use
this feature.
-Kumar
-----Original Message-----
Sent: Thursday, January 15, 2009 7:59 PM
Subject: Re: Customizing Solr to handle Leading Wildcard queries
Post by Jana, Kumar RajaNot being able to perform Leading Wildcard queries is a major handicap.
I want to be able to perform searches like *.pdf to fetch all pdf
documents from Solr.
For this particular case, I recommend indexing the document type as a
separate field. Something like type:pdf (or use a MIME type string).
Then you can do a very direct and fast query to search or facet by
document types.
Erik