You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Xuesong Luo <xl...@successfactors.com> on 2008/02/26 02:05:10 UTC

range query failed if highlight is used

Hi, 
I'm using solr1.3 nightly build. I defined a sint field bookCount. When
I query on this field, it works fine without highlight. However if I
turn on highlight(hl=true&hl.fl=bookCount), it failed due to the error
below. Does anyone know if this is a bug? If I change the type to
integer, the highlight work, but I need to do range query on this field,
so it has to be defined as sint.
 
Thanks
Xuesong
 
 
2008-02-25 16:54:53,524 ERROR [STDERR] Feb 25, 2008 4:54:53 PM
org.apache.solr.core.SolrCore execute
INFO: [xluo] /select/
rows=10&start=0&hl.fl=bookCount&indent=on&q=bookCount:5&hl=true&version=
2.2 0 0

2008-02-25 16:54:53,524 ERROR [STDERR] Feb 25, 2008 4:54:53 PM
org.apache.solr.common.SolrException log
SEVERE: java.lang.NumberFormatException: For input string: "   "
 at
java.lang.NumberFormatException.forInputString(NumberFormatException.jav
a:48)
 at java.lang.Long.parseLong(Long.java:403)
 at java.lang.Long.parseLong(Long.java:461)
 at
org.apache.solr.util.NumberUtils.long2sortableStr(NumberUtils.java:52)
 at
org.apache.solr.schema.SortableLongField.toInternal(SortableLongField.ja
va:49)
 at
org.apache.solr.schema.FieldType$DefaultAnalyzer$1.next(FieldType.java:3
15)
 at
org.apache.solr.highlight.TokenOrderingFilter.next(SolrHighlighter.java:
439)
 at
org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(High
lighter.java:226)

 


 

 

RE: range query failed if highlight is used

Posted by Xuesong Luo <xl...@successfactors.com>.
Thanks Hoss, I created https://issues.apache.org/jira/browse/SOLR-491 to
check this bug

The reason I need to highlight the numeric or data field is I have to
loop through the search result to apply role permission check on those
fields. If the searcher doesn't have permission to see the numeric/date
field of the user in the search result list, that field should be set to
null when returned. If the search doesn't have permission on all
matching fields, then the whole record should not be returned. How can I
find out which fields are the matching fields if the searcher is
searching on multiple fields? The only easy way I can think about is if
the field is highlighted, it's a matching field. 
  
Does it make sense?

Thanks
Xuesong

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: Tuesday, February 26, 2008 6:06 PM
To: solr-user@lucene.apache.org
Subject: Re: range query failed if highlight is used


: I'm using solr1.3 nightly build. I defined a sint field bookCount.
When
: I query on this field, it works fine without highlight. However if I
: turn on highlight(hl=true&hl.fl=bookCount), it failed due to the error

I'm not sure if i really understand what it would mean to highlight a
numeric field,  hilighting a range query probably won't ever work
because of the way range queries are implemented in Solr ... but at the
very least there should be a better error message in this case.  (and
the case of a simple single value numeric lookup should probably work)

could you please file a bug for this?

:
rows=10&start=0&hl.fl=bookCount&indent=on&q=bookCount:5&hl=true&version=
: 2.2 0 0
: 
: 2008-02-25 16:54:53,524 ERROR [STDERR] Feb 25, 2008 4:54:53 PM
: org.apache.solr.common.SolrException log
: SEVERE: java.lang.NumberFormatException: For input string: "   "



-Hoss

Re: range query failed if highlight is used

Posted by Chris Hostetter <ho...@fucit.org>.
: I'm using solr1.3 nightly build. I defined a sint field bookCount. When
: I query on this field, it works fine without highlight. However if I
: turn on highlight(hl=true&hl.fl=bookCount), it failed due to the error

I'm not sure if i really understand what it would mean to highlight a 
numeric field,  hilighting a range query probably won't ever work 
because of the way range queries are implemented in Solr ... but at the 
very least there should be a better error message in this case.  (and the 
case of a simple single value numeric lookup should probably work)

could you please file a bug for this?

: rows=10&start=0&hl.fl=bookCount&indent=on&q=bookCount:5&hl=true&version=
: 2.2 0 0
: 
: 2008-02-25 16:54:53,524 ERROR [STDERR] Feb 25, 2008 4:54:53 PM
: org.apache.solr.common.SolrException log
: SEVERE: java.lang.NumberFormatException: For input string: "   "



-Hoss