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.



enter image description here










share|improve this question























  • 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











  • 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














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.



enter image description here










share|improve this question























  • 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











  • 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












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.



enter image description here










share|improve this question















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.



enter image description here







solr solr-highlight






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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










  • @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










  • @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










  • @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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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





















































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