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: Search with special characters
Date Thu, 03 Aug 2017 11:42:39 GMT
That will not solve this issue, the OP seems to be wanting to actually
search on that token. Sergey, try escaping it ("22\/")

Besides, searching for *(text)* in Lucene is an anti-pattern. Read on
analyzers and tokenizers and try to see how you can avoid that.

--

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

On Thu, Aug 3, 2017 at 7:00 AM, Shad Storhaug <shad@shadstorhaug.com> wrote:

> Sergey,
>
> Have a look at the SimpleQueryParser. It is designed for human-entered
> input which may contain invalid characters.
>
> https://lucene.apache.org/core/4_8_0/queryparser/index.html
> https://github.com/apache/lucenenet/blob/master/src/
> Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
>
> Thanks,
> Shad Storhaug (NightOwl888)
>
> -----Original Message-----
> From: Sergey Zaharov [mailto:sergozaharov@gmail.com]
> Sent: Thursday, August 3, 2017 5:53 AM
> To: user@lucenenet.apache.org
> Subject: Search with special characters
>
> Hi all,
>
> I have a problem with searching when my search string contains some of
> special characters. As example, string var textQry = parser.Parse("*22/*");
> raise  an unhandled exception of type 'Lucene.Net.QueryParsers.Classic.ParseException'
> occurred in Lucene.Net.QueryParser.dll but it works fine if search string
> do not contains /
>
> Is it any way to search with the string which contains such characters?
> If that not possible, where can  i find a list of characters, which
> doesnot allowed in the search string in case i will exclude them from
> string.
>
> Sample solution you could find by the link https://drive.google.com/open?
> id=0B4yKxCojuj4fbjV3bjl5c0JPeUE
>
> Many thanks in advance,
> Sergey.
>

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