lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Itamar Syn-Hershko <ita...@code972.com>
Subject Re: Avoid letter searches
Date Thu, 29 Dec 2016 16:58:11 GMT
Diego, what are you trying to do? It looks like you are using Lucene in an
incorrect way. You shouldn't be using wildcards all around.

--

Itamar Syn-Hershko
Freelance Developer & Consultant
Elasticsearch Consulting Partner
Microsoft MVP | Lucene.NET PMC
http://code972.com | @synhershko <https://twitter.com/synhershko>
http://BigDataBoutique.co.il/

On Thu, Dec 29, 2016 at 6:49 PM, Koga, Diego <dikoga@gmail.com> wrote:

> But that is to avoid indexing, isn't it?
>
> If so, I'll still have the problem because my searches uses the
> wildcard "*" at the end.
>
> Or does it filter also the query when it parses:
>
>             var parser = new
> MultiFieldQueryParser(Lucene.Net.Util.Version.LUCENE_30,
> fieldsToSearch, _analyzer);
>
>             keyword = keyword.Replace("-", " ");
>
>             keyword = QueryParser.Escape(keyword);
>
>             var main = parser.Parse(string.Join(" ",
> keyword.Trim().Split(' ').Where(x =>
> !string.IsNullOrEmpty(x)).Select(x => x.Trim() == "*" ? x.Trim() :
> x.Trim() + "*")));
>
>
>
>
> Att.,
> ------------------
> Koga, Diego
>
>
> On Thu, Dec 29, 2016 at 11:26 AM, Itamar Syn-Hershko <itamar@code972.com>
> wrote:
> > Yes,
> > https://lucene.apache.org/core/4_5_0/analyzers-common/
> org/apache/lucene/analysis/miscellaneous/LengthFilter.html
> >
> > https://github.com/apache/lucenenet/blob/master/src/
> Lucene.Net.Core/Analysis/LengthFilter.cs
> >
> > --
> >
> > Itamar Syn-Hershko
> > http://code972.com | @synhershko <https://twitter.com/synhershko>
> > Freelance Developer & Consultant
> > Lucene.NET committer and PMC member
> >
> > On Thu, Dec 29, 2016 at 6:17 PM, Koga, Diego <dikoga@gmail.com> wrote:
> >
> >> Guys,
> >>
> >> I am facing an issue if the search is letters like: a b c d e f g.
> >>
> >> These letters are everywhere which causes high amounts of processing
> >> and does not mean anything at the end.
> >>
> >> Is there any way to avoid it other than split by spaces and check the
> >> length of the string?
> >>
> >>
> >> Thanks,
> >>
> >>
> >> Att.,
> >> ------------------
> >> Koga, Diego
> >>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message