Search widget Not working

  1. Avatar of Yogesh

    i have installed lucene search module of BetterCms and here is my Cms configuration - <search> <add key="LuceneWebSiteUrl" value="http://localhost:15112/" /> <add key="LuceneFileSystemDirectory" value="~/LuceneIndex" /> <add key="LuceneIndexerFrequency" value="00:01:00" /> <add key="LuceneIndexerPageFetchTimeout" value="00:01:00" /> <add key="LucenePagesWatcherFrequency" value="00:01:00" /> <add key="LuceneMaxPagesPerQuery" value="1000" /> <add key="LucenePageExpireTimeout" value="00:00:00" /> <add key="LuceneDisableStopWords" value="true" /> <add key="LuceneSearchForPartOfWords" value="true" /> <add key="LuceneIndexPrivatePages" value="true" /> <add key="LuceneAuthorizationUrl" value="hhttp://localhost:15112/login" /> <add key="LuceneAuthorizationForm.UserName" value="admin" /> <add key="LuceneAuthorizationForm.Password" value="admin" /> <add key="LuceneAuthorizationForm.RememberMe" value="true" /> </search> but it is showing 0 results for content which exist , anybody with a solution?

  2. Avatar of Yogesh

    an issue with the same scenario is also reported at http://www.bettercms.com/support/widgets-and-modules/lucene-search-widget-doesnt-work/ and he suggested to add "Search" category to pages for getting result , i tried the same but still not getting any search result. please help

  3. Avatar of Simonas

    Hi Yogesh,

    if you are running the latest BetterCMS version 1.10.1, please double check your search configuration "LuceneAuthorizationUrl" option (you pasted it with double H letter hhttp://localhost:15112/login). If this does not solve your issue, please check if there are not issues reported in log file (how to setup logging: http://www.bettercms.com/documentation/logging).

    Cheers, Simonas

  4. Avatar of Yogesh

    great , the hhttp://localhost:15112/login issue was just a typo* but setting up the n Log configuration does the trick . now it works fine , just one more thing to clear can we setup any facet/category/filters kind of functionality with the search box?

  5. Avatar of Simonas

    Nice :)

    Talking about customizing search widget - nop, search widget is not highly customizable, it contains only couple of options, that can be changed via UI. So, you'll need to create a new search widget.

    More info on search API: https://github.com/devbridge/BetterCMS/wiki/Web-API-for-Developers#--------searches-within-pages-content

  6. Avatar of Yogesh

    as i can see Search API is not returning any category or something by which we can differentiate in which section (i.e page/blog/article) search query got matched, So is there any way by which we can get to know that search API have returned us blog or page or article?

  7. Avatar of Simonas

    Yes, you can get additional info about search results by using api.Pages.Pages.Get() API: https://github.com/devbridge/BetterCMS/wiki/Web-API-for-Developers#--------get-a-list-of-pages

    The workflow can be something like this:

    1) get search results from var searchResultList = api.Pages.Pages.Search([*REQUEST*])

    2) construct request filter for getting pages data:

    var pagesRequest = new GetPagesRequest();
    pagesRequest.Data.Filter = new DataFilter();
    foreach (var model in searchResultList.Data.Items)
    {
        pagesRequest.Data.Filter.Add("PageUrl", model.Link);
    }
    pagesRequest.Data.Filter.Connector = FilterConnector.Or;
    pagesRequest.Data.IncludeCategories = true;
    var pagesResult = api.Pages.Pages.Get(pagesRequest));
    var pages = pagesResult.Data.Items.ToList();
    

    3) Combine data from both searches 1) and 2) to construct your results.

    Cheers,
    Simonas

  8. Avatar of Darsana

    Hi, I have the same problem, I entered the keywords for peculiar pages. When I searched with Search input and search results widget. I didn't find any search results.Already installed Lucene search module Kindly Help me.Here is my configuration code <search> <add key="LuceneWebSiteUrl" value="http://localhost:58000/" /> <add key="LuceneFileSystemDirectory" value="~/Lucene_Directory/" /> <add key="LuceneIndexerFrequency" value="00:01:00" /> <add key="LuceneIndexerPageFetchTimeout" value="00:01:00" /> <add key="LucenePagesWatcherFrequency" value="00:00:00" /> <add key="LuceneMaxPagesPerQuery" value="1000" /> <add key="LucenePageExpireTimeout" value="00:00:00" /> <add key="LuceneDisableStopWords" value="true" /> <add key="LuceneSearchForPartOfWords" value="true" /> <add key="LuceneIndexPrivatePages" value="true" /> <add key="LuceneAuthorizationUrl" value="http://localhost:58000/login" /> <add key="LuceneAuthorizationForm.UserName" value="admin" /> <add key="LuceneAuthorizationForm.Password" value="admin" /> <add key="LuceneAuthorizationForm.RememberMe" value="true" /></search>

    Thanks Darsana.R

  9. Avatar of Darsana

    Apart from this, I have used the suggested code from the above follow up. Here is my code , using (var api = ApiFactory.Create()) { // var pageRequest = new GetPageRequest { PageUrl = "/" }; //var searchResultList = api.Pages.Pages.Get(pageRequest); var searchResultList = api.Pages.Pages.Get([REQUEST]); var pagesRequest = new GetPagesRequest(); pagesRequest.Data.Filter = new DataFilter(); foreach (var model in searchResultList.Data.Items) { pagesRequest.Data.Filter.Add("PageUrl", model.Link); } pagesRequest.Data.Filter.Connector = FilterConnector.Or; pagesRequest.Data.IncludeCategories = true; var pagesResult = api.Pages.Pages.Get(pagesRequest); var pages = pagesResult.Data.Items.ToList(); return pages; return null; } How can I pass the request?.see the code with commenting symbols. I used the page request type, but it not supporting for search content pages. Kindly help me.

    Thanks, Darsana.R

* Mandatory
* Mandatory
* Mandatory

Verify that you are human