Site Search using Fluent API

Posted by Community Admin on 05-Aug-2018 22:01

Site Search using Fluent API

All Replies

Posted by Community Admin on 02-May-2011 00:00

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.

Posted by Community Admin on 03-May-2011 00:00

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

Posted by Community Admin on 03-May-2011 00:00

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?

Posted by Community Admin on 03-May-2011 00:00

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

Posted by Community Admin on 09-May-2011 00:00

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.

Posted by Community Admin on 09-May-2011 00:00

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

Posted by Community Admin on 09-May-2011 00:00

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.

Posted by Community Admin on 12-May-2011 00:00

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

Posted by Community Admin on 12-May-2011 00:00

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?

Posted by Community Admin on 18-May-2011 00:00

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

This thread is closed