Mohammad Abul Khaer created SOLR-6010:
-----------------------------------------
Summary: Wrong highlighting while querying by date range with wild
card in the end range
Key: SOLR-6010
URL: https://issues.apache.org/jira/browse/SOLR-6010
Project: Solr
Issue Type: Bug
Components: highlighter, query parsers
Affects Versions: 4.0
Environment: java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
Linux 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64
x86_64 x86_64 GNU/Linux
Reporter: Mohammad Abul Khaer
Solr is returning wrong highlights when I have a date range query with wild
card *in the end range*. For example my query *q* is
{noformat}
(story)+activatedate:[* TO
2014-04-24T09:55:00Z]+expiredate:[2014-04-24T09:55:00Z TO *]
{noformat}
In the above query activatedate, expiredate are date fields. Their definition
in schema file is as follows
{code}
<field name="activatedate" type="date" indexed="true" stored="false"
omitNorms="true"/>
<field name="expiredate" type="date" indexed="true" stored="false"
omitNorms="true"/>
{code}
In the query result I am getting wrong highlighting information. Only
highlighting result is show below
{code}
"highlighting": {
"article:3605": {
"title": [
"The <em>creative</em> <em>headline</em> of this <em>story</em>
<em>really</em> <em>says</em> it <em>all</em>"
],
"summary": [
"<em>Etiam</em> <em>porta</em> <em>sem</em> <em>malesuada</em>
<em>magna</em> <em>mollis</em> <em>euismod</em> <em>aenean</em> <em>eu</em>
<em>leo</em> <em>quam</em>. <em>Pellentesque</em> <em>ornare</em> <em>sem</em>
<em>lacinia</em> <em>quam</em>."
]
},
"article:3604": {
"title": [
"The <em>creative</em> <em>headline</em> of this <em>story</em>
<em>really</em> <em>says</em> it <em>all</em>"
],
"summary": [
"<em>Etiam</em> <em>porta</em> <em>sem</em> <em>malesuada</em>
<em>magna</em> <em>mollis</em> <em>euismod</em> <em>aenean</em> <em>eu</em>
<em>leo</em> <em>quam</em>. <em>Pellentesque</em> <em>ornare</em> <em>sem</em>
<em>lacinia</em> <em>quam</em>.."
]
}
}
{code}
It should highlight only *story* word but it is highlighting lot other words
also. What I noticed that this happens only if I have a wildcard * in the end
range. If I change the above query and set a fixed date in the end range
instead of * then solr return correct highlights. Modified query is shown below
-
{noformat}
(story)+activatedate:[* TO
2014-04-24T09:55:00Z]+expiredate:[2014-04-24T09:55:00Z TO 3014-04-24T09:55:00Z]
{noformat}
I guess its a bug in SOLR. If I use filter query *fq* instead of normal query
*q* then highlighting result is OK for both queries.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]