<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using jcr:score ,we are not retrieving search results with highest occurrence in Adobe Experience Manager Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462532#M133503</link>
    <description>&lt;P&gt;Try&amp;nbsp;&lt;A href="http://localhost:4502/bin/querybuilder.json?fulltext=insurance&amp;amp;orderby=@jcr:score&amp;amp;orderby.sort=desc" target="_blank"&gt;http://localhost:4502/bin/querybuilder.json?fulltext=insurance&amp;amp;orderby=@jcr:score&amp;amp;orderby.sort=desc&lt;/A&gt;&amp;nbsp;in your browser.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ref:&amp;nbsp;&lt;A href="https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md" target="_blank"&gt;https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 08:51:04 GMT</pubDate>
    <dc:creator>HImanshu_Jain_</dc:creator>
    <dc:date>2022-07-25T08:51:04Z</dc:date>
    <item>
      <title>Using jcr:score ,we are not retrieving search results with highest occurrence</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462531#M133502</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;We are using AEM6.5 and trying to achieve search results with highest word count(ex:insurance) on top in descending order but we see the results(webpages) displayed randomly .&lt;/P&gt;
&lt;P&gt;Ex: Using QueryBuilder Debugger&lt;/P&gt;
&lt;P&gt;path=/content/&amp;lt;project-path&amp;gt;&lt;BR /&gt;type=cq:Page&lt;BR /&gt;fulltext=insurance&lt;BR /&gt;orderby.sort=desc&lt;BR /&gt;orderby=@jcr:score&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Please suggest how to achieve word with highest occurrence in page to be listed on top in search results using sql2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 08:39:51 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462531#M133502</guid>
      <dc:creator>GanaG</dc:creator>
      <dc:date>2022-07-25T08:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using jcr:score ,we are not retrieving search results with highest occurrence</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462532#M133503</link>
      <description>&lt;P&gt;Try&amp;nbsp;&lt;A href="http://localhost:4502/bin/querybuilder.json?fulltext=insurance&amp;amp;orderby=@jcr:score&amp;amp;orderby.sort=desc" target="_blank"&gt;http://localhost:4502/bin/querybuilder.json?fulltext=insurance&amp;amp;orderby=@jcr:score&amp;amp;orderby.sort=desc&lt;/A&gt;&amp;nbsp;in your browser.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ref:&amp;nbsp;&lt;A href="https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md" target="_blank"&gt;https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 08:51:04 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462532#M133503</guid>
      <dc:creator>HImanshu_Jain_</dc:creator>
      <dc:date>2022-07-25T08:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using jcr:score ,we are not retrieving search results with highest occurrence</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462544#M133507</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17452997"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have tried the same but the results are not consistent.&lt;/P&gt;
&lt;P&gt;Please try below:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://localhost:4502/bin/querybuilder.json?fulltext=Equipment&amp;amp;orderby=%40jcr%3ascore&amp;amp;orderby.sort=desc&amp;amp;p.limit=-1&amp;amp;path=%2fcontent%2fwe-retail%2fca%2fen" target="_blank" rel="noopener"&gt;http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&amp;amp;query=path%3D%2Fcontent%2Fwe-retail%2Fca%2Fen%0D%0Afulltext%3DEquipment%0D%0Ap.limit%3D-1%0D%0Aorderby%3D%40jcr%3Ascore%0D%0Aorderby.sort%3Ddeschttp://localhost:4502/bin/querybuilder.json?fulltext=Equipment&amp;amp;orderby=%40jcr%3ascore&amp;amp;orderby.sort=desc&amp;amp;p.limit=-1&amp;amp;path=%2fcontent%2fwe-retail%2fca%2fen&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Result which is displayed first shows 6 occurrence of "equipment" word in browser&lt;/P&gt;
&lt;P&gt;&lt;A href="http://localhost:4502/content/we-retail/ca/en/equipment.html" target="_blank" rel="noopener"&gt;http://localhost:4502/content/we-retail/ca/en/equipment.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where as&amp;nbsp;&lt;A href="http://localhost:4502/content/we-retail/ca/en/products/equipment.html" target="_blank" rel="noopener"&gt;http://localhost:4502/content/we-retail/ca/en/products/equipment.html&lt;/A&gt;&amp;nbsp;which is displayed next shows 22 occurrence of "equipment" word .&lt;/P&gt;
&lt;P&gt;last result shows 1 occurrence of "equipment" word&amp;nbsp;&lt;A href="http://localhost:4502/content/we-retail/ca/en/experience/arctic-surfing-in-lofoten/jcr%3acontent/root/responsivegrid/contentfragment.html" target="_blank" rel="noopener"&gt;http://localhost:4502/content/we-retail/ca/en/experience/arctic-surfing-in-lofoten/jcr%3acontent/root/responsivegrid/contentfragment.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ideally lucene should give results based on Term frequency&amp;nbsp;only&amp;nbsp;which is not happening.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please check.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 11:06:17 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462544#M133507</guid>
      <dc:creator>GanaG</dc:creator>
      <dc:date>2022-07-25T11:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using jcr:score ,we are not retrieving search results with highest occurrence</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462563#M133512</link>
      <description>&lt;P&gt;Hi &lt;LI-USER uid="17556809"&gt;&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;This is correct behavior. In your example you are referring to occurrence of word &lt;EM&gt;equipment&lt;/EM&gt; in browser, but what you can see in browser does not mean that is content of this specific page. Let's have a closer look on this one&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;where as&amp;nbsp;&lt;A href="http://localhost:4502/content/we-retail/ca/en/products/equipment.html" target="_blank" rel="noopener nofollow noreferrer"&gt;http://localhost:4502/content/we-retail/ca/en/products/equipment.html&lt;/A&gt;&amp;nbsp;which is displayed next shows 22 occurrence of "equipment" word .&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you will go to crx you will see that this page contains only 2 occurrence of word &lt;EM&gt;equipment&lt;/EM&gt; not 22. Other occurrence you can see in the browser is content from other pages that are referenced via &lt;EM&gt;Product Grid&lt;/EM&gt; component.&lt;/P&gt;
&lt;P&gt;I do not think this is correct way to recognize how many times specific word is used, you should rely on what is inside nodes in crx instead. It's because this is used to build index, not values that can be seen on final page.&lt;/P&gt;
&lt;P&gt;I have used simple SQL2 query for given scenario:&lt;/P&gt;
&lt;PRE&gt;SELECT * FROM [cq:Page] AS s WHERE ISDESCENDANTNODE([/content/we-retail/ca/en]) and CONTAINS(s.*, 'Equipment') &lt;/PRE&gt;
&lt;P&gt;And it's giving proper results when we look what's in the repository. In terms of SQL2 query itself, you do not have to add explicitly &lt;EM&gt;ORDER BY [jcr:score] DESC&lt;/EM&gt; because this is default behavior, URL to documentation that describes this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://jackrabbit.apache.org/oak/docs/query/grammar-sql2.html#ordering" target="_blank" rel="noopener"&gt;https://jackrabbit.apache.org/oak/docs/query/grammar-sql2.html#ordering&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you want to control order of results you can utilize boost option in your index:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://jackrabbit.apache.org/oak/docs/query/lucene.html#boost" target="_blank" rel="noopener"&gt;https://jackrabbit.apache.org/oak/docs/query/lucene.html#boost&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 25 Jul 2022 13:54:25 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/462563#M133512</guid>
      <dc:creator>lukasz-m</dc:creator>
      <dc:date>2022-07-25T13:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using jcr:score ,we are not retrieving search results with highest occurrence</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/539823#M134098</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="14599365"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using boost, specific property like jcr:title or jcr:description search results appears on top but in our case we need to display search results in descending order based on more number of occurrence(i.e max. word count in a page) of the search term in a page.&lt;/P&gt;
&lt;P&gt;ex: If insurance occurrences in page1 20 times, in page2 10 mins, in page3 15 times and page4 25 times then we need to display the result as page4, page1, page3, page2.&lt;/P&gt;
&lt;P&gt;Please provide your suggestion&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 09:21:37 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/using-jcr-score-we-are-not-retrieving-search-results-with/m-p/539823#M134098</guid>
      <dc:creator>GanaG</dc:creator>
      <dc:date>2022-08-08T09:21:37Z</dc:date>
    </item>
  </channel>
</rss>

