November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi, Torrunn,
There shouldn't be any issues around the structure you have listed that would affect the search. I would rather think that the issue might be the result of the other query expressions.
Have you tried to exclude all other query expressions and search just with the root set to the category page in question? Does it still return 0 items?
BR,
Marija
Hi, Marija
I tried to strip down the search expression to this:
private static int MaxResult = 100; var query = CreateQuery(searchText, searchRoots, context, languageBranch); private IQueryExpression CreateQuery(string searchText, IEnumerable<ContentReference> searchRoots, HttpContextBase context, string languageBranch) { var query = new GroupQuery(LuceneOperator.AND); query.QueryExpressions.Add(new FieldQuery(searchText)); foreach (var root in searchRoots) { var contentRootQuery = new VirtualPathQuery(); contentRootQuery.AddContentNodes(root); query.QueryExpressions.Add(contentRootQuery); } return query; } return _searchHandler.GetSearchResults(query, 1, MaxResult);
The root is set to the productlist page, but gives no results.
Hi, Torunn,
If you are not sending in multiple search roots, the query should definitely work. If not so, you need another OR query:
var typeQueries = new GroupQuery(LuceneOperator.OR); query.QueryExpressions.Add(typeQueries); foreach (var root in searchRoots) { var contentRootQuery = new VirtualPathQuery(); contentRootQuery.AddContentNodes(root); typeQueries.QueryExpressions.Add(contentRootQuery); }
If you are sending one search root and not getting any results, might be that the index is corrupt. I'd try deleting and rebuilding it, if possible, just to rule that out.
BR,
Marija
If neither helps, then it might be worth contacting Episerver support giving them the source code and DB, then they can troubleshoot further.
Hi,
I'm only passing one root, and I have tried to reeindex. Do you know if there is any other way to delete the index than to check the checkbox for delete content, when using the "Admin/IndexContent.aspx" function?
You can stop the site, delete the contents of the index folder, then start the site again and click Reindex under IndexContent.aspx.
Hi!
I have a page structure like this:
Products
Productcategory
Productlist
Product
Product
Some times, there are multiple productcategories, like this:
Products
Productcategory
Productcategory
Productlist
Product
Product
On the productlist page I have a search function, that search the product children. It gives no result for the products with multiple productcategories. I can't see any other differences between the two cases. The first one gives results as excpected. The root in the code below is set to the productlist page.
var contentRootQuery = new VirtualPathQuery();
contentRootQuery.AddContentNodes(root);
typeQueries.QueryExpressions.Add(contentRootQuery);
I'm banging my head against the wall.....any ideas?