Solr highlighting to include hyphenated results returned by search
up vote
3
down vote
favorite
Is there a way to get Solr to highlight the match if it includes hyphens?
In the image below, the search was 1600 and Solr highlighted the exact match. However, the search also matched on 16-00 but it was not highlighted. These are product sku's and we're trying to highlight them even if they are hyphenated.
Solr version: 5.2.1
The only setting added was hl.fl below. All the rest are not set and use the Solr defaults:
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true">
<!-- default values for query parameters -->
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="hl.fl">summary title </str>
Note: portions of the image were redacted. That is why the results don't line up.

solr solr-highlight
|
show 1 more comment
up vote
3
down vote
favorite
Is there a way to get Solr to highlight the match if it includes hyphens?
In the image below, the search was 1600 and Solr highlighted the exact match. However, the search also matched on 16-00 but it was not highlighted. These are product sku's and we're trying to highlight them even if they are hyphenated.
Solr version: 5.2.1
The only setting added was hl.fl below. All the rest are not set and use the Solr defaults:
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true">
<!-- default values for query parameters -->
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="hl.fl">summary title </str>
Note: portions of the image were redacted. That is why the results don't line up.

solr solr-highlight
What is your highlighting query?
– MatsLindh
Nov 8 at 22:36
@matslindh The search query is1600.hl.qis not set so it is the solr default.
– jk.
Nov 8 at 22:41
I'm thinking of all the hl-settings - there are multiple settings that affect how the analysis is performed.
– MatsLindh
Nov 9 at 7:54
@MatsLindh Yes, there are. I looked through them and couldn't figure out which one would do the trick. Changing them involves tremendous trial and error (in this case pure shots in the dark) that with every change requires stopping and starting Solr and rebuilding the collection.
– jk.
Nov 9 at 15:17
But if you don't provide your current settings, its very hard to say why you get the behaviour you get - and what to correct. You usually don't have to rebuild the index itself (or start and stop Solr - reloading the core should do the trick). I can also recommend testing on a much smaller dataset when experimenting instead of the complete set of documents.
– MatsLindh
Nov 9 at 18:13
|
show 1 more comment
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Is there a way to get Solr to highlight the match if it includes hyphens?
In the image below, the search was 1600 and Solr highlighted the exact match. However, the search also matched on 16-00 but it was not highlighted. These are product sku's and we're trying to highlight them even if they are hyphenated.
Solr version: 5.2.1
The only setting added was hl.fl below. All the rest are not set and use the Solr defaults:
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true">
<!-- default values for query parameters -->
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="hl.fl">summary title </str>
Note: portions of the image were redacted. That is why the results don't line up.

solr solr-highlight
Is there a way to get Solr to highlight the match if it includes hyphens?
In the image below, the search was 1600 and Solr highlighted the exact match. However, the search also matched on 16-00 but it was not highlighted. These are product sku's and we're trying to highlight them even if they are hyphenated.
Solr version: 5.2.1
The only setting added was hl.fl below. All the rest are not set and use the Solr defaults:
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true">
<!-- default values for query parameters -->
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="hl.fl">summary title </str>
Note: portions of the image were redacted. That is why the results don't line up.

solr solr-highlight
solr solr-highlight
edited Nov 9 at 18:23
asked Nov 8 at 21:25
jk.
13.3k33654
13.3k33654
What is your highlighting query?
– MatsLindh
Nov 8 at 22:36
@matslindh The search query is1600.hl.qis not set so it is the solr default.
– jk.
Nov 8 at 22:41
I'm thinking of all the hl-settings - there are multiple settings that affect how the analysis is performed.
– MatsLindh
Nov 9 at 7:54
@MatsLindh Yes, there are. I looked through them and couldn't figure out which one would do the trick. Changing them involves tremendous trial and error (in this case pure shots in the dark) that with every change requires stopping and starting Solr and rebuilding the collection.
– jk.
Nov 9 at 15:17
But if you don't provide your current settings, its very hard to say why you get the behaviour you get - and what to correct. You usually don't have to rebuild the index itself (or start and stop Solr - reloading the core should do the trick). I can also recommend testing on a much smaller dataset when experimenting instead of the complete set of documents.
– MatsLindh
Nov 9 at 18:13
|
show 1 more comment
What is your highlighting query?
– MatsLindh
Nov 8 at 22:36
@matslindh The search query is1600.hl.qis not set so it is the solr default.
– jk.
Nov 8 at 22:41
I'm thinking of all the hl-settings - there are multiple settings that affect how the analysis is performed.
– MatsLindh
Nov 9 at 7:54
@MatsLindh Yes, there are. I looked through them and couldn't figure out which one would do the trick. Changing them involves tremendous trial and error (in this case pure shots in the dark) that with every change requires stopping and starting Solr and rebuilding the collection.
– jk.
Nov 9 at 15:17
But if you don't provide your current settings, its very hard to say why you get the behaviour you get - and what to correct. You usually don't have to rebuild the index itself (or start and stop Solr - reloading the core should do the trick). I can also recommend testing on a much smaller dataset when experimenting instead of the complete set of documents.
– MatsLindh
Nov 9 at 18:13
What is your highlighting query?
– MatsLindh
Nov 8 at 22:36
What is your highlighting query?
– MatsLindh
Nov 8 at 22:36
@matslindh The search query is
1600. hl.q is not set so it is the solr default.– jk.
Nov 8 at 22:41
@matslindh The search query is
1600. hl.q is not set so it is the solr default.– jk.
Nov 8 at 22:41
I'm thinking of all the hl-settings - there are multiple settings that affect how the analysis is performed.
– MatsLindh
Nov 9 at 7:54
I'm thinking of all the hl-settings - there are multiple settings that affect how the analysis is performed.
– MatsLindh
Nov 9 at 7:54
@MatsLindh Yes, there are. I looked through them and couldn't figure out which one would do the trick. Changing them involves tremendous trial and error (in this case pure shots in the dark) that with every change requires stopping and starting Solr and rebuilding the collection.
– jk.
Nov 9 at 15:17
@MatsLindh Yes, there are. I looked through them and couldn't figure out which one would do the trick. Changing them involves tremendous trial and error (in this case pure shots in the dark) that with every change requires stopping and starting Solr and rebuilding the collection.
– jk.
Nov 9 at 15:17
But if you don't provide your current settings, its very hard to say why you get the behaviour you get - and what to correct. You usually don't have to rebuild the index itself (or start and stop Solr - reloading the core should do the trick). I can also recommend testing on a much smaller dataset when experimenting instead of the complete set of documents.
– MatsLindh
Nov 9 at 18:13
But if you don't provide your current settings, its very hard to say why you get the behaviour you get - and what to correct. You usually don't have to rebuild the index itself (or start and stop Solr - reloading the core should do the trick). I can also recommend testing on a much smaller dataset when experimenting instead of the complete set of documents.
– MatsLindh
Nov 9 at 18:13
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53216376%2fsolr-highlighting-to-include-hyphenated-results-returned-by-search%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What is your highlighting query?
– MatsLindh
Nov 8 at 22:36
@matslindh The search query is
1600.hl.qis not set so it is the solr default.– jk.
Nov 8 at 22:41
I'm thinking of all the hl-settings - there are multiple settings that affect how the analysis is performed.
– MatsLindh
Nov 9 at 7:54
@MatsLindh Yes, there are. I looked through them and couldn't figure out which one would do the trick. Changing them involves tremendous trial and error (in this case pure shots in the dark) that with every change requires stopping and starting Solr and rebuilding the collection.
– jk.
Nov 9 at 15:17
But if you don't provide your current settings, its very hard to say why you get the behaviour you get - and what to correct. You usually don't have to rebuild the index itself (or start and stop Solr - reloading the core should do the trick). I can also recommend testing on a much smaller dataset when experimenting instead of the complete set of documents.
– MatsLindh
Nov 9 at 18:13