Can you paste the full code you are using to iterate the results? Can you also confirm that if you remove ".Filter(x => x.InternalArticleNumber.Match("11111"))" you get results?
David
The code for iterating the results is irrelevant since it never goes into my if statement as follows:
if (articles.Any())
{
// Iteration
}
If I do:
ITypeSearch<Article> articleQuery = client.Search<Article>();
IContentResult<Article> articles = articleQuery.GetContentResult();
I get 10 hits in articles (since Find reduces number of hits to 10). I would also like to add that this code was working before, suddenly it always returns 0, and I verified that the value I'm trying to filter is in the database.
/J
You might've done something to the articles permissions.
You can use Fiddler to see what role- and user names are being sent with the query and the index overview browser to see what the indexed ACL is.
Could also have something to do with PublishStatus or one of the other automatic filters. Again Fiddler can give clues.
Without filter does it return some value? if Yes
Are other Articles working? if Yes
Check In Online Center->Find Explorer, Has this page been indexed or not?
/K
GetContentResult loads the original content from the db before returning. Does the user executing the query have read access to the content?
The number of items returned in the result doesn't reflect the total hits (as you have seen the default number returned is 10 and this can be changed using query.Take(numberOfItemsToReturn)). To see the number of items that matched your query in the index use results.TotalMatching (this will always return the number of hits in the index indepentden on the requested result size you have set using query.Take()).
/Henrik
EPiServer Commerce 8.7.1, CMS 7.19.
I'm trying to filter some articles from Find, but it always returns 0 hits even though there is articles with the value I'm trying to filter on. My code is following:
IClient client = Client.CreateFromConfig();
articleQuery = client.Search().Filter(x => x.InternalArticleNumber.Match("11111")); articles = articleQuery.GetContentResult();
ITypeSearch
IContentResult
I've cleared Index and reindexed but without any luck. Any ideas?
/J