Question

I have a simple document structure such as:

public class CulturedData
{
    public string Culture { get; set; }
    public string Text { get; set; }
}

public class Product
{
    public int Id { get; set; }
    public decimal Price { get; set; }
    public List<CulturedData> Titles { get; set; }
    public List<CulturedData> Descriptions { get; set; }
}

Culture = "EN" or "DE" or "FR" etc.

I am wondering the best way to keyword search for products using their respective Text properties. The Text content for Descriptions could be quite large, maybe 20-30K. What is the best way to index this sort of data, and would I need a separate index for each culture?

It would also be nice to use the More Like This feature, so does this mean I am forced down a particular indexing path?

Any further questions/explanation please ask.

Regards Phil

Was it helpful?

Solution

You can use a single index, like this:

from p in products
select new
{
   _ = p.Titles.Select(x=>CreateField("Titles_" + x.Culture, x.Text)),
   _+ = p.Descriptions.Select(x=>CreateField("Descriptions_" + x.Culture, x.Text)),
}

And that should give you what you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top