Indexing hierarchical structures


(Yuriy Vasilyev) #1

Hi,

I'm searching on data that consists from City, Street and Address.
If I make plain structure and store all in one index

long CityId;
string City; // London
long StreetId;
string Street; // Baker street 221b
long AddressId;
string Address; // 221b
string SearchString; // London, Baker street, 221b

But I also need to update index.
The problem is to update City if there is a mistake (for instance). I
need to update 1 million records.

Is it possible to make search friendly structure, that must not
require to update all records, but to update only reference to City
(Street)?

Now I search using in combination with prefix search on some
particular fields

var query = @"""fuzzy_like_this"": {
""fields"" : [""city"",
""street"", ""address"", ""building"", ""searchString""],
""like_text"":""" + searchQuery +
@""",
""percent_terms_to_match"":0.85,
""min_term_freq"" : 0,
""prefix_length"" : 0,
""min_similarity"" : 0.85,
""ignore_tf"" : true

                         }";

Thanks


(Karussell) #2

Is it possible to make search friendly structure, that must not
require to update all records, but to update only reference to City
(Street)?

No, there isn't although there is this server side feature:

Peter.


(Yuriy Vasilyev) #3

Thanks a lot for link, it's very usefull!

Is there any best practice to organize hierarchical indexces?
For instance is there any point to make nested document City with
fields CityName and CityId?

Yuriy.

On 8 фев, 20:06, Karussell tableyourt...@googlemail.com wrote:

Is it possible to make search friendly structure, that must not
require to update all records, but to update only reference to City
(Street)?

No, there isn't although there is this server side feature:

https://github.com/medcl/elasticsearch-partialupdate

Peter.


(Nick Hoffman) #4

Hi Yuriy. I'm a bit confused regarding your requirements. However, a
parent-child relationship might help you here.


(system) #5