Setting up my first examine search with Razor and there's a few things aren't quite working as I'd expect.
EG if I search on "press" I get 4 results, "press release one", "press release two" etc. but if I search on "press release" I get no results at all. This remains true for every example where I search on one word and I get results, but I search on two words that are adjacent I always get nothing.
I don't need anything particularly more complex than this.
var searchTerm = Request.QueryString["s"];
var searchProvider = ExamineManager.Instance.DefaultSearchProvider.Name;
var pagesToList = ExamineManager.Instance.SearchProviderCollection[searchProvider].Search(searchTerm, true);
Also I tried using the ucomponents quicksearch and got the same results.
I'm wondering if the issue could be how the index is set up.
Again following the example on farmcode I have added
I think you need to escape the search term? I'm not sure how you'd do it with the default search syntax that you're using. I normally use the Fluent API, which is just a case of putting .Escape() on the end of the search term.
You can check the index by running Luke on it and seeing what's in the index. You can also run queries on the data in Luke to try and see what's going on.
Examine Returns Results on only One Word
Setting up my first examine search with Razor and there's a few things aren't quite working as I'd expect.
EG if I search on "press" I get 4 results, "press release one", "press release two" etc. but if I search on "press release" I get no results at all. This remains true for every example where I search on one word and I get results, but I search on two words that are adjacent I always get nothing.
I don't need anything particularly more complex than this.
I've been following this example. http://farmcode.org/post/2011/03/15/Searching-Umbraco-using-Razor-and-Examine.aspx So the code I have looks like this:
I think you need to escape the search term? I'm not sure how you'd do it with the default search syntax that you're using. I normally use the Fluent API, which is just a case of putting .Escape() on the end of the search term.
You can check the index by running Luke on it and seeing what's in the index. You can also run queries on the data in Luke to try and see what's going on.
thanks Tim, I'll give that a go :)
the code I put above was wrong by the way ... some of my messing about trying things got included in that :-$
should have just been
is working on a reply...