Indexing hierarchical structures

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Indexing hierarchical structures

Yuriy Vasilyev
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
Reply | Threaded
Open this post in threaded view
|

Re: Indexing hierarchical structures

Karussell

> 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.
Reply | Threaded
Open this post in threaded view
|

Re: Indexing hierarchical structures

Yuriy Vasilyev
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 <[hidden email]> 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.
Reply | Threaded
Open this post in threaded view
|

Re: Indexing hierarchical structures

Nick Hoffman
In reply to this post by Yuriy Vasilyev
Hi Yuriy. I'm a bit confused regarding your requirements. However, a parent-child relationship might help you here.