lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Lucene 2.4 - Searching
Date Tue, 27 Jan 2009 20:06:41 GMT
Hi


Sounds like a job for RegexQuery.  If you can't figure out how to use
it Google will throw up some examples.  You can downcase everything
yourself or use an analyzer that does it or maybe use a case
insensitive regexp.

Depending on your file names you might want to avoid StandardAnalyzer.
 It is likely to split them.  KeywordAnalyzer might be what you want.


--
Ian.


On Tue, Jan 27, 2009 at 7:29 PM, Karl Heinz Marbaise <khmarbaise@gmx.de> wrote:
> Hi there,
>
> I'm trying to do a, from my point of view, simple thing.
>
> I would like to do a search ignoring the case of the stored information in
> the index...with the following code:
>
> reader = IndexReader.open(indexDirectory);
>
> Searcher searcher = new IndexSearcher(reader);
> Analyzer analyzer = new StandardAnalyzer();
>
> //Created my own Query parse to handle ranges like filed:[1 TO 6]
> QueryParser parser = new CustomQueryParser(FieldNames.CONTENTS, analyzer);
> parser.setAllowLeadingWildcard(true);
> parser.setLowercaseExpandedTerms(false);
> Query query = parser.parse(queryLine);
>
> TopDocs tmp = searcher.search(query, null, 20, sort);
>
> To be more percisely...
>
> I have a field which is called filename and contains a filename which can of
> course be lowercase or upppercase or a mixture...
>
> I would like to do the following:
>
> +filename:/*scm*.doc
>
> That should result in getting things like
>
> /...SCMtest.doc
> /...scmtest.doc
> /...scm.doc
> etc.
>
> May be someone can give me hint how to solve this...
>
> kind regards
> Karl Heinz Marbaise
> --
> SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
> Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
> Hauptstrasse 177                         USt.IdNr: DE191347579
> 52146 W├╝rselen                           http://www.soebes.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message