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 Mikael Andersson <mi...@daddy.se> on 2001/11/13 14:03:50 UTC

FW: national characters

If I use a swedish national character as the first character of
a search term, for example:

öl

(which is beer in Swedish :)) I get the following error:

com.lucene.queryParser.TokenMgrError: Lexical error at line 1, column 1.
 Encountered: "\u00f6" (246), after : ""
	at java.lang.Throwable.fillInStackTrace(Native Method)
	at java.lang.Throwable.fillInStackTrace(Compiled Code)
	at java.lang.Throwable.<init>(Compiled Code)
	at java.lang.Error.<init>(Error.java:50)
	at
com.lucene.queryParser.TokenMgrError.<init>(TokenMgrError.java:126)

If I do the same search again but within quotations like below:

"öl"

...it works perfectly.

If I use Swedish characters after the first character it also works.

Lucene version is 1.2rc2 and standard Analysers etc. Is swedish a
supported
language ? If so, where can I find the appropriate classes ?

Any help would be greatly appreciated!

I noticed the same problem on bybdylan.com, to see the complete
stacktrace
follow the link below.
 
http://search.bobdylan.com/lyricsearch/searchResults.jsp?doSearch=true&q
=%F6l&range=50

Rgds/ Mikael



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Searching all the fields (and II)

Posted by Kelvin Tan <ke...@relevanz.com>.
>First thank to Kelvin Tan and the rest of the people for his support and
help.

You're most welcome.

>Well, I talked to my boss and  I suggested the posibility of create a new
field with all the content. This thing duplicate the Index but >the search
was still very very quick. But the man didn´t accept this way so... now I
make one search for each of my fields and, at >the same time, I filt the
hits with a HashSet. What do you think about this ?

Are you looking to search on all the fields? If so, I guess this is an OK
approach, but I believe your results may be distorted unless all Hits are
sorted by score before adding to the HashSet.

Regards,
Kelvin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Searching all the fields (and II)

Posted by David Bonilla <da...@bit-bang.com>.
First thank to Kelvin Tan and the rest of the people for his support and help.

Well, I talked to my boss and  I suggested the posibility of create a new field with all the content. This thing duplicate the Index but the search was still very very quick. But the man didn´t accept this way so... now I make one search for each of my fields and, at the same time, I filt the hits with a HashSet. What do you think about this ?
__________________________
David Bonilla Fuertes
THE BIT BANG NETWORK
http://www.bit-bang.com
Profesor Waksman, 8, 6º B
28036 Madrid
SPAIN
Tel.: (+34) 914 577 747
Móvil: 656 62 83 92
Fax: (+34) 914 586 176
__________________________
 
 

Re: Searching all the fields

Posted by Kelvin Tan <ke...@relevanz.com>.
Yep, I posted the code on Tuesday. It's somewhat more flexible than the
method suggested in the FAQ.

It's not in the mail-archives yet, so if you want it just drop me an email.

Regards,
Kelvin

----- Original Message -----
From: Ian Lea <ia...@blackwell.co.uk>
To: Lucene Users List <lu...@jakarta.apache.org>
Sent: Wednesday, November 14, 2001 9:11 PM
Subject: Re: Searching all the fields


> You can't do it that way.  One way is to gather all the fields
> you want to search across into one big field called "contents"
> or something.  That is in the FAQ at
>
http://www.lucene.com/cgi-bin/faq/faqmanager.cgi?file=chapter.search&toc=faq
#q12
> and is the way I do it.
>
> A few days ago someone posted some code that, I think, took a term
> and prefixed it with assorted different field names.  If my
> recollection is correct that might be another way.
>
>
>
> --
> Ian.
> ian.lea@blackwell.co.uk
>
>
> David Bonilla wrote:
> >
> > If I want to search a word in all my fields, can I do it passing the
String field like a null to a QueryParser ? If I can´t do it this way, what
must I do ?
> > __________________________
> > David Bonilla Fuertes
> > THE BIT BANG NETWORK
> > http://www.bit-bang.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Searching all the fields

Posted by Ian Lea <ia...@blackwell.co.uk>.
You can't do it that way.  One way is to gather all the fields
you want to search across into one big field called "contents"
or something.  That is in the FAQ at
http://www.lucene.com/cgi-bin/faq/faqmanager.cgi?file=chapter.search&toc=faq#q12
and is the way I do it.

A few days ago someone posted some code that, I think, took a term
and prefixed it with assorted different field names.  If my
recollection is correct that might be another way.



--
Ian.
ian.lea@blackwell.co.uk


David Bonilla wrote:
> 
> If I want to search a word in all my fields, can I do it passing the String field like a null to a QueryParser ? If I can´t do it this way, what must I do ?
> __________________________
> David Bonilla Fuertes
> THE BIT BANG NETWORK
> http://www.bit-bang.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Searching all the fields

Posted by David Bonilla <da...@bit-bang.com>.
If I want to search a word in all my fields, can I do it passing the String field like a null to a QueryParser ? If I can´t do it this way, what must I do ?
__________________________
David Bonilla Fuertes
THE BIT BANG NETWORK
http://www.bit-bang.com
Profesor Waksman, 8, 6º B
28036 Madrid
SPAIN
Tel.: (+34) 914 577 747
Móvil: 656 62 83 92
Fax: (+34) 914 586 176
__________________________
 
 

Lucene and the numbers (again!)

Posted by David Bonilla <da...@bit-bang.com>.
Dear mates :

Yeah I know that i´m not very original and maybe the FAQ can resolve my problems but I didn´t find any real help there. Ok... here we go :

The problem is... I have a J2EE application working with LUCENE and the basic searching works properly but when I try to use a query with a number, Lucene gives me back all my indexed documents and I don´t understand why.

I´m using the SimpleAnalyzer. If I have for example a document with a field named "name". How can I search for example a name like '456' ?

Thank U for your help and advice !!!

__________________________
David Bonilla Fuertes
THE BIT BANG NETWORK
http://www.bit-bang.com
Profesor Waksman, 8, 6º B
28036 Madrid
SPAIN
Tel.: (+34) 914 577 747
Móvil: 656 62 83 92
Fax: (+34) 914 586 176
__________________________