I want to store date tags for my resources in a separate field of the document in the form of 'yyyyMMdd'. There may be many tags for single document. So my setup is as follows:
public class Resource
{
//…
public IEnumerable<string> DateTags { get; set; }
}
…
map.Property(r => r.DateTags).ToField("DateTag").NotAnalyzedNoNorms();
And I need to query all the documents that belongs to particular year, for example. I'm trying to utilize StartsWith but with no success.
var items = provider.AsQueryable(map.ToDocumentMapper()).Where(r => r.DateTags.Any(dt => dt.StartsWith("1999")));
This query always return all the documents. What am I doing wrong?
I want to store date tags for my resources in a separate field of the document in the form of 'yyyyMMdd'. There may be many tags for single document. So my setup is as follows:
And I need to query all the documents that belongs to particular year, for example. I'm trying to utilize StartsWith but with no success.
This query always return all the documents. What am I doing wrong?