Lucene escape characters
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   slava_litskevich
Posted On:   Wednesday, April 13, 2005 01:53 AM

I'm searching for a word or phrase containing special character, e.g. "some-any" , and i want to find only exact matches. So I don't want to find a document containing phrase "some any" . The problem is that I do get it as a result. I use StandardAnalyzer for indexing and searching. WhitespaceAnalyzer will not do as I still want to be able to search for the word "any" and find the document containing "some-any" . I tried following query variants: "some-any" ""some-any"" ""some-any"" - no use: I always find the document with "some any&q   More>>

I'm searching for a word or phrase containing special character, e.g. "some-any" , and i want to find only exact matches. So I don't want to find a document containing phrase "some any" . The problem is that I do get it as a result.


I use StandardAnalyzer for indexing and searching. WhitespaceAnalyzer will not do as I still want to be able to search for the word "any" and find the document containing "some-any" .


I tried following query variants:

  • "some-any"
  • ""some-any""
  • ""some-any""

    - no use: I always find the document with "some any"

    Lucene version 1.4.


    Thanks in advance for any ideas.

    Slava
  •    <<Less

    Re: Lucene escape characters

    Posted By:   Otis_Gospodnetic  
    Posted On:   Thursday, April 14, 2005 08:35 AM

    You should make your own analyzer and tokenizer that doesn't split tokens on characters like '-'.
    About | Sitemap | Contact