Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C439A200CEF for ; Mon, 4 Sep 2017 13:02:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C2C79164BDB; Mon, 4 Sep 2017 11:02:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1592A164BD8 for ; Mon, 4 Sep 2017 13:02:01 +0200 (CEST) Received: (qmail 21173 invoked by uid 500); 4 Sep 2017 11:02:00 -0000 Mailing-List: contact dev-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucenenet.apache.org Delivered-To: mailing list dev@lucenenet.apache.org Received: (qmail 21161 invoked by uid 99); 4 Sep 2017 11:02:00 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Sep 2017 11:02:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 3CCEF1A4ECB for ; Mon, 4 Sep 2017 11:02:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id G7NS0dBQCeBR for ; Mon, 4 Sep 2017 11:01:54 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4CB2362F5B for ; Mon, 4 Sep 2017 10:31:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 998FBE0E1A for ; Mon, 4 Sep 2017 10:31:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 43F1324157 for ; Mon, 4 Sep 2017 10:31:02 +0000 (UTC) Date: Mon, 4 Sep 2017 10:31:02 +0000 (UTC) From: "Singaravelu (JIRA)" To: dev@lucenenet.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LUCENENET-595) Wildcard search with special characters "#" not working MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 04 Sep 2017 11:02:03 -0000 [ https://issues.apache.org/jira/browse/LUCENENET-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152448#comment-16152448 ] Singaravelu commented on LUCENENET-595: --------------------------------------- Hi Shad, Thanks for your immediate response and the suggestions. I have tried with WhitespaceAnalyzer, unfortunately it didn't worked. Then I have created my own Analyzer using the WhitespaceTokenizer and it wroked. Thanks once again. Singaravelu > Wildcard search with special characters "#" not working > ------------------------------------------------------- > > Key: LUCENENET-595 > URL: https://issues.apache.org/jira/browse/LUCENENET-595 > Project: Lucene.Net > Issue Type: Bug > Components: Lucene.Net Core > Affects Versions: Lucene.Net 3.0.3 > Reporter: Singaravelu > Priority: Blocker > > I'm using Lucene.Net 3.0.3.0 version in my website to search list of courses. > I have few courses which contains the special character "#" like, C#, C#.Net, etc. > But When I search with the term "C#" it showing 0 results. > I'm using StandardAnalyzer and MultiFieldQueryParser also allowing wildcard search (AllowLeadingWildcard = true). > Here is my code: > var analyzer = new StandardAnalyzer(Version.LUCENE_30, stopWords); > { > BooleanQuery query = new BooleanQuery(); > var nameParser = new MultiFieldQueryParser(Version.LUCENE_30, new[] { "Column1", " Column2", " Column3" }, analyzer); > if (!string.IsNullOrEmpty(searchCriteria.CourseName)) > { > query.Add(parseQuery(GetTerms(searchCriteria.CourseName.ReplaceDiacritics()), nameParser), Occur.MUST); > } > ScoreDoc[] hits = searcher.Search(query, null, hits_limit, Sort.RELEVANCE).ScoreDocs; > var results = _mapLuceneToDataList(hits, searcher); > analyzer.Close(); > searcher.Dispose(); > return results; > } > For indexing: > The word "C#" indexed and stored correctly. > doc.Add(new Field("Title", sampleData.CourseName, Field.Store.YES, Field.Index.ANALYZED)); > Kindly let me know what I have to do to retrieve the result when I search with the term "C#". -- This message was sent by Atlassian JIRA (v6.4.14#64029)