+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Site Search using Fluent API

Site Search using Fluent API

10 posts, 0 answered
  1. Chris
    Chris avatar
    21 posts
    Registered:
    16 Aug 2010
    02 May 2011
    Link to this post
    The design of the site I'm working on has the search bar very integrated into the design, so the standard SiteFinity search box control will not work.  It needs to have the custom design.

    Is there a way to search one or more of the Search Indicies using the Fluent API or is there another way to accomplish my task?

    Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    03 May 2011
    Link to this post
    Hello Chris,

    The SearchIndex allows you to combine pipes - this is the starting point for creating an index. Is there a reason why you do not use this out of the box solution?

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. Chris
    Chris avatar
    21 posts
    Registered:
    16 Aug 2010
    03 May 2011
    Link to this post
    As I said in my previous post, the reason I cannot use the standard "Search Box" control is because of the design.  It simply will not work with my site design.

    My question had nothing to do with "combining pipes", and you don't even explain exactly what that is.  Also, creating an index isn't my issue.  I've created the index using the interface built into SiteFinity.

    What I'm trying to do is actually create my own control that USES the search index that I've already created.  As I said, due to the limited, plain design of the built in search box, I cannot use that control and I need to create my own.

    Is there a way I can do that using the API, or do I have to somehow redesign the layout portion of the built in control?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    03 May 2011
    Link to this post
    Hi Chris,

    There is no fluent API that you can use with the Search. SearchBox and SearchResults are closely related controls. If you are going to have a custom SearchBox and you want to keep the SearchResults in your custom control you should pass the following parameters to the query string, so the SearchResult can read them

    IndexCatalogue - name of the pipe

    searchQuery - the text you are looking for.

    You can also replace the SearchResult control, but in this case you need to implement your own mechanism that will return IResultSet objects

                        var searchManager = SearchManager.GetManager(null);
                        IResultSet result = searchManager.Find(
                            this.IndexCatalogue,
                            searchQuery,
                            skip,
                            take
                            );

    Regards,
    Ivan Dimitrov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  5. Geoff
    Geoff avatar
    89 posts
    Registered:
    02 Mar 2011
    09 May 2011
    Link to this post
    Chris, were you able to get this to work?  If so, which version of Sitefinity are you running (4.0, 4.0 SP1, 4.1)?  I have a similar thread running here, but haven't had much luck or feedback getting the issue resolved.

    Thanks.
  6. Chris
    Chris avatar
    21 posts
    Registered:
    16 Aug 2010
    09 May 2011
    Link to this post
    I was able to get this working in 4.1.

    What I did find, though, is that partial word searches don't work.  I have multiple pages that have the word "vaneaxial" on them.  Those pages are all returned when searching for "vaneaxial" but not when searching for "van".
  7. Geoff
    Geoff avatar
    89 posts
    Registered:
    02 Mar 2011
    09 May 2011
    Link to this post
    Thanks for the info, Chris.

    Can anyone from the Telerik team let me know if this was a bug that was resolved in 4.1?  I am not able to get this code to work in 4.0 SP1 and am unable to upgrade my client's project to 4.1 because of breaking bugs.

    Thanks.
  8. Teodor
    Teodor avatar
    52 posts
    Registered:
    24 Sep 2012
    12 May 2011
    Link to this post
    Hello Geoff,

    When you do a partial search you should use '*' for example "van*".

    Regards,
    Teodor
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  9. Chris
    Chris avatar
    21 posts
    Registered:
    16 Aug 2010
    12 May 2011
    Link to this post
    Thanks, Teodor, but this isn't very intuitive for a regular website user.

    Can you post a link to documentation for using the built-in search so I can post it for my users?
  10. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    18 May 2011
    Link to this post
    Hi Chris,

    The search in Sitefinity uses the Lucene.NET indexing engine and is based on words. Partial search (searching for parts of a word) is advanced functionality which we support, but users should supply different queries to use it. This is similar to using quotes or specific prefixes in Google.

    Unfortunately we don't have user documentation that explains all this. We'll log it as a task and work on creating some, based on the Lucene principles. I suspect we will be able to publish i for the 4.2 release.

    All the best,
    Slavo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

10 posts, 0 answered