Showing posts with label autocomplete. Show all posts
Showing posts with label autocomplete. Show all posts

Thursday, July 27, 2023

Transition of Sitecore public feeds from MyGet to NuGet after November 2023

Hi All,


Might few of aware about Sitecore public feed transition from MyGet to Nuget after November 2023.

As that is currently in transition we faced build issue in our project and get to know about this issue.

One we updated the feed as per below link our project build started again without any issues.

For more details follow below link.

https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB1002999


I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles. Till that happy Sitecoring :) Please leave your comments or share this article if it’s useful for you. 

Wednesday, February 8, 2017

Solr Configuration for providing search suggestions

Hi All,

Today we discuss how we configure solr for provide search suggestion.
For that I follow 2 blogs which are listed below the blog.

https://blog.horizontalintegration.com/2015/07/20/configuring-solr-to-provide-search-suggestions/

http://www.nttdatasitecore.com/Blog/2017/January/Faceted-Autocomplete-for-a-Sitecore-Multilingual-site-using-SOLR-Suggester-API

By using help of these blog I can configure solr with auto suggest. I use 1st blog for setup solr and using 2nd blog Building jQuery Autocomplete jquery : jquery function for autocomplete suggestion.

Note:
1.Keep in mind while follow first blog for updating solrconfig.xml field str contain the name of the field for example:
<searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
        <str name="name">fuzzySuggester</str>
       ...
        <str name="field">page_title_t</str>
    ...
    </lst>
    <lst name="suggester">
        <str name="name">infixSuggester</str>
      ...
        <str name="field">page_title_t</str>
       ...
    </lst>
</searchComponent>

2. While using 2nd blog jquery function its give cross platform error , solution also provide in that blog but i am not able to resolve that so i use my solution that are below:
<script type="text/javascript">
        $('#search-field').autocomplete({
            source: function (request, response) {
                var currentLanguage = 'en';
                var url = "http://localhost:8983/solr/custom_index_autocomplete/suggest?suggest.q=" + request.term + "&suggest.cfq=" + currentLanguage + "&wt=json&json.wrf=?";
                $.getJSON(url, function (data) {
                    //response($.map(data.suggest.suggester[request.term].suggestions, function (value) { return value.term }));
                    response($.map(data.suggest.fuzzySuggester[request.term].suggestions, function (value) { return value.term }));
                });
            }
        });
</script>

3. For combined multiple indexes for autosuggestion please follow as below:

   <script type="text/javascript">
        $('#search-field').autocomplete({
            source: function (request, response) {
                var currentLanguage = 'en';
                var url = "http://localhost:8983/solr/custom_index_autocomplete/suggest?suggest.q=" + request.term + "&suggest.cfq=" + currentLanguage + "&wt=json&json.wrf=?";
                var url1 = "http://localhost:8038/solr/content/suggest?suggest.q=" + request.term + "&suggest.cfq=" + currentLanguage + "&wt=json&json.wrf=?";

                var res;
                var res1;
                $.getJSON(url, function (data) {
                    res = data.suggest.fuzzySuggester[request.term].suggestions;
                    $.getJSON(url1, function (data) {
                        res1 = res.concat(data.suggest.fuzzySuggester[request.term].suggestions);
                        response($.map(res1, function (value)
                        { return value.term }
                           ));
                    });
                });
            }
        });
    </script>