-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Search] Extend query #19
Comments
As in the previous issue, what is your Use Case ? The goal of Kinetix.Search is to provide an high level abstraction for real case queries. If you need low level query object, maybe we should add a specific use case for search instead of opening the API. |
As explained in Thomas' mail: We need to do some specific querying and computation not available with the way the api work today. For example, compute distances. But a more low level wrapping offered by Kinetix around Nest object using the Documents and there annotations can still be an improvement. Need to think about it. |
Ok, so what was your idea about exposing a Nest object in a callback :
Moreover, I prefer to expose a dedicated Method with callback (like a CustomAdvancedQuery) whereas exposing directly an optional parameter that could be wrongly overloaded by a developper : |
Can you list all the usage you will need in the Search Api ? What is your needs about the distances computation ? |
I think exposing the client is great, it will allow us to fallback more easily to it if necessary. I agree with that exposing a callback in a custom method is better. My document will have coordinates information about its geographic position. I need to find all documents that are in a range of X km of a search position. Something like that as filter : m => m.GeoShapeMultiPolygon(g =>
g.Field(fi => fi.Polygone)
.Relation(GeoShapeRelation.Intersects)
.Coordinates(zones.Geometries.Cast<Polygon>().Select(
zone =>new[] { zone.ExteriorRing.Coordinates }
.Concat(zone.InteriorRings.Select(ring => ring.Coordinates)))
.Select(c => c.Select(d => d.Select(e => new GeoCoordinate(e.Y, e.X)))))), So if I can access the Nest object I'll be able to add that custom filter. |
As discussed, we need to support GeoQueries in Kinetix.Search (and in Vertigo) |
I'm sorry but I fail to see the point of trying to abstract over such a complex area of queries (and indexing) when ElasticSearch (with Nest) already offers everything we might need in a relatively convenient way, provided the client is exposed. Nest is the defacto standard, we already use it and there are plenty of examples in the docs and everywhere else on the internet about that. We don't have a lot of manpower to spend on this and the closer we stay to what already exists, works and is widely used, the more we'll be able to work on high-added-value areas. As it stands today, and I'm saying that after having spent quite some time using and improving it, I think that the Search module is way too opinionated and abstracts away a lot of stuff that should at least been opened for extension. Sure, it does the job of providing the advanced search API for Focus applications very well, but it should be allowed to do more than that because projects can have all sorts of other valid uses for ElasticSearch. I don't think trying to come up with all the solutions before any problem arises is a good use of anyone's time, instead we should be focusing on what projects need and try to find a solution for that together if it hasn't been done before, and see if it is relevant to include in the shared framework or if it's not worth it. To go back to the original issue of GeoQueries, I don't think we have anything specific to offer about that because the scenarios aren't really predictable like the advanced search is. But there are multiple roadblocks currently preventing projects to use them, which are:
I have a working prototype of this (along with ES6 support) in the Core version of Kinetix.Search that I use in my project that I'd be more than happy and willing to share, to use as a starting point for further improvements. EDIT: I'm not sure if the original discussion was about simply exposing the client or providing a way of customizing the AdvancedQuery with Nest constructs to add custom filters, facets and groupings. I was only speaking about the former, the latter will probably require a significant rewrite of the query builder to accommodate for it. Filtering only might be doable pretty easily thought, but I don't think there is that much value here, the "killer" feature being faceting. They leak everywhere from aggregations to grouping to filters and post filters (to handle multi-selection where applicable), and even if we already have a If we were to tackle this issue, the answer can't just be about supporting @c3dr0x's specific need because you can be damn sure than someone else will come in a few months with a similar request but not quite, so that the existing API won't cover its problem and we'll have to start over again, making the query builder bigger and bigger until it becomes a giant pile of spaghetti code that no one will ever be able to untangle. |
When calling AdvancedQuery method, we shall be able a give an optional parameter giving access to the NEST object to extend query as needed without having to build everything from scratch
The text was updated successfully, but these errors were encountered: