EPiServer Find returns 0 hits when filtering

Vote:
 

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();

ITypeSearch

articleQuery = client.Search
().Filter(x => x.InternalArticleNumber.Match("11111"));
IContentResult
articles = articleQuery.GetContentResult();

I've cleared Index and reindexed but without any luck. Any ideas?

/J

#120425
Apr 16, 2015 15:14
Vote:
 

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

#120435
Apr 16, 2015 17:09
Vote:
 

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

#120445
Apr 17, 2015 9:58
Vote:
 

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.

#120450
Apr 17, 2015 12:11
Vote:
 

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

#120467
Apr 17, 2015 15:39
Vote:
 

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

#120622
Apr 21, 2015 12:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.