You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Nathaniel Auvil <na...@gmail.com> on 2010/07/01 20:56:06 UTC

search for a string which begins with a '$' character

i am trying to search for a value which begins with a '$' or even sometimes
'$$'.  '$' is not listed as a special character and no matter what i try, i
can not get a search for $* to return anything.  Using Luke, i browse my
index and see several entries where the value exists with a leading '$'.
How can i search for these?

Re: search for a string which begins with a '$' character

Posted by Erick Erickson <er...@gmail.com>.
You're probably getting mislead by storing .vs. indexing.
When you say that the '$' is showing up in Luke, I'm
guessing that what you actually are looking at is the
stored value rather than the indexed tokens. You can
look at both with Luke, but it can be confusing...

FWIW
Erick

On Thu, Jul 1, 2010 at 2:56 PM, Nathaniel Auvil
<na...@gmail.com>wrote:

> i am trying to search for a value which begins with a '$' or even sometimes
> '$$'.  '$' is not listed as a special character and no matter what i try, i
> can not get a search for $* to return anything.  Using Luke, i browse my
> index and see several entries where the value exists with a leading '$'.
> How can i search for these?
>

Re: search for a string which begins with a '$' character

Posted by Ahmet Arslan <io...@yahoo.com>.
> WhitespaceAnalyzer is case sensitive.  Is there a way
> to
> make it case insensitive?

You can build your custom analyzer using WhitespaceTokenizer + LowercaseFilter. Source code of an existing analyzer will help you.

public TokenStream tokenStream(String fieldName, Reader reader) {
    WhitespaceTokenizer tokenStream = new WhitespaceTokenizer(matchVersion, reader);
    tokenStream = new LowerCaseFilter(result); 
    return result;
  }


      

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


Re: search for a string which begins with a '$' character

Posted by Nathaniel Auvil <na...@gmail.com>.
this works, however WhitespaceAnalyzer is case sensitive.  Is there a way to
make it case insensitive?


On Sat, Jul 3, 2010 at 7:37 AM, Ahmet Arslan <io...@yahoo.com> wrote:

> > I am using this analyzer:
> > @Analyzer(impl =
> > org.apache.lucene.analysis.standard.StandardAnalyzer.class)
> >
> > "$" is not inlcluded in the STOP_WORDS for this
> > analyzer.  Is there
> > somewhere else i should be looking?  When i use Luke
> > with the
> > standardAnalyzer, it does not parse the query.  Is
> > there a way to see why?
>
> "$" won't survive StandardAnalyzer. You can use WhitespaceAnalyzer instead.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: search for a string which begins with a '$' character

Posted by Ahmet Arslan <io...@yahoo.com>.
> I am using this analyzer:
> @Analyzer(impl =
> org.apache.lucene.analysis.standard.StandardAnalyzer.class)
> 
> "$" is not inlcluded in the STOP_WORDS for this
> analyzer.  Is there
> somewhere else i should be looking?  When i use Luke
> with the
> standardAnalyzer, it does not parse the query.  Is
> there a way to see why?

"$" won't survive StandardAnalyzer. You can use WhitespaceAnalyzer instead.


      

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


Re: search for a string which begins with a '$' character

Posted by Nathaniel Auvil <na...@gmail.com>.
I am using this analyzer: @Analyzer(impl =
org.apache.lucene.analysis.standard.StandardAnalyzer.class)

"$" is not inlcluded in the STOP_WORDS for this analyzer.  Is there
somewhere else i should be looking?  When i use Luke with the
standardAnalyzer, it does not parse the query.  Is there a way to see why?



On Fri, Jul 2, 2010 at 9:29 AM, Grant Ingersoll <gs...@apache.org> wrote:

> What analyzer are you using?  Did you check that it is making it through
> your analyzer?
>
> -Grant
>
> On Jul 1, 2010, at 2:56 PM, Nathaniel Auvil wrote:
>
> > i am trying to search for a value which begins with a '$' or even
> sometimes
> > '$$'.  '$' is not listed as a special character and no matter what i try,
> i
> > can not get a search for $* to return anything.  Using Luke, i browse my
> > index and see several entries where the value exists with a leading '$'.
> > How can i search for these?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: search for a string which begins with a '$' character

Posted by Grant Ingersoll <gs...@apache.org>.
What analyzer are you using?  Did you check that it is making it through your analyzer?

-Grant

On Jul 1, 2010, at 2:56 PM, Nathaniel Auvil wrote:

> i am trying to search for a value which begins with a '$' or even sometimes
> '$$'.  '$' is not listed as a special character and no matter what i try, i
> can not get a search for $* to return anything.  Using Luke, i browse my
> index and see several entries where the value exists with a leading '$'.
> How can i search for these?


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