I'm evaluating es for our ecommerce enivironment and ran in a problem:
I want to use es with its facet search for building the frontend filters.
For example: The user could browse some usb sticks and filter all sticks on
"capacity" with the value "4 GB".
I need the list of possible properties and its values to build the html.
A product could look like this:
product {
properties : {
capacity : "4 GB"
speed : "32 MB/s"
}
name : "very good usb stick"
}
The properties of course differ with each product.
A result I'm searching for could be:
I'm evaluating es for our ecommerce enivironment and ran in a problem:
I want to use es with its facet search for building the frontend filters.
For example: The user could browse some usb sticks and filter all sticks on
"capacity" with the value "4 GB".
I need the list of possible properties and its values to build the html.
A product could look like this:
product {
properties : {
capacity : "4 GB"
speed : "32 MB/s"
}
name : "very good usb stick"
}
The properties of course differ with each product.
A result I'm searching for could be:
yes I tried the term facet.
Perhaps I'm missing some details about it, but I could not discover how to
configure a term facet to use the dynamic combination of a property and its
values.
If there was a field like this:
{
tags: ["a", "b", "c"]
}
the facet looks like this:
"facets" : {
"tag" : {
"terms" : {
"field" : "tag"
}
}
}
But how to configure it, if the tags are not a single string, but a
document like this: tags : [{property: "capacity", value: "4 GB"},
{property: "speed", value: "32 MB/s"}]?
In this case the key is the document and not a single string.
Its difficult for me to describe the Problem in english, but I hope you
understand it
i didnt measure it.
In my prototype its fast enough, but i dont like the way.
Es is a document orientated datastore and i hoped it could solve this issue
without this splitting thing.
As I can see, es today can only do faceted search on keys, which are are
single token (like the tag example).
It would be great if someday hole documents could be key, so my problem
will be natively solved without doing something strange.
I hoped I only missed the feature in the documentation.
You can't do generic property name / generic property value faceting, aside
from maybe using scripting (depends on exactly what you are after). But, I
think from your question that you know that you want to facet on something
like property name of capacity, no? If so, why not index the property name
as part of the json field name and facet on it? Or do you want to get all
the facets for all the properties defined for all the products?
no I don't know what exactly properties I have to facet on.
I used some examples here to show you how the properties COULD look like in
my product-documents.
Alle products have different properties and values, some more, some less.
I only have a set of products (result of the search) and need all the
combinations of the properties/values to generate the frontend filters.
So, to make it visual:
A customer searched for "usb stick", gets the search result with a list of
products and additionally these filters on the side:
Since we have the mapping information, we might be able to do this, i.e.
automatically generate facets for all the properly names assuming they are
used as field names. But, you can also do it yourself, you can ask for the
mapping, it will include all the fields names options, and build the facets
request based on that. (note, the properly names will need to be fields in
the document).
no I don't know what exactly properties I have to facet on.
I used some examples here to show you how the properties COULD look like
in my product-documents.
Alle products have different properties and values, some more, some less.
I only have a set of products (result of the search) and need all the
combinations of the properties/values to generate the frontend filters.
So, to make it visual:
A customer searched for "usb stick", gets the search result with a list of
products and additionally these filters on the side:
Hi, Shay. I'm trying to implement the same scheme as topicstarter.
I didn't understand what do you mean by 'automatically generate facets for
all the properly names assuming they are used as field names'.
Should I directly define mapping for every property in properties list I
have? But what if there are dynamic? I.e. in first document the properties
are {color: 'black', size: 'XL'}, in the second are {capacity: '2Gb',
generation: '5'}, etc. (and there may be a lot of types of product,so
different document types is not a desirable solution)
понедельник, 12 декабря 2011 г., 19:08:15 UTC+6 пользователь kimchy написал:
Since we have the mapping information, we might be able to do this, i.e.
automatically generate facets for all the properly names assuming they are
used as field names. But, you can also do it yourself, you can ask for the
mapping, it will include all the fields names options, and build the facets
request based on that. (note, the properly names will need to be fields in
the document).
To give an update on this:
I used the "workaround" with the concatenating of the property and its
values.
The application has to split the facet-results and group it manually by the
properties.
The speed is good and so we'll use most likely that way for facetting our
properties in our application.
On Friday, December 9, 2011 12:13:43 PM UTC+1, maik wrote:
Yes, but this only results in something like that:
facets : [
"capacity": 100,
"speed": 150
]
There is no connection to the value, and this is needed.
I helped me out in a way i don't like:
properties : ["capacity###4 GB", "speed###32 MB/s"]
A facet on the properties field results like this:
facets: [
"capacity###4 GB" : 30,
"capacity###8 GB" : 20,
"speed###16 MB/s": 10,
"speed###32 MB/s" : 40
]
I have to split the properties and values in the application with the
split-argument "###".
Thats not very fast.
Hi, Shay. I'm trying to implement the same scheme as topicstarter.
I didn't understand what do you mean by 'automatically generate facets for
all the properly names assuming they are used as field names'.
Should I directly define mapping for every property in properties list I
have? But what if there are dynamic? I.e. in first document the properties
are {color: 'black', size: 'XL'}, in the second are {capacity: '2Gb',
generation: '5'}, etc. (and there may be a lot of types of product,so
different document types is not a desirable solution)
понедельник, 12 декабря 2011 г., 19:08:15 UTC+6 пользователь kimchy
написал:
Since we have the mapping information, we might be able to do this, i.e.
automatically generate facets for all the properly names assuming they are
used as field names. But, you can also do it yourself, you can ask for the
mapping, it will include all the fields names options, and build the facets
request based on that. (note, the properly names will need to be fields in
the document).
Do you then filter values by concatenating you facet again? I.e. filtering
properties by "capacity###4 Gb" or do you have different fields for proper
filtering?
пятница, 1 июня 2012 г., 13:24:05 UTC+6 пользователь maik написал:
To give an update on this:
I used the "workaround" with the concatenating of the property and its
values.
The application has to split the facet-results and group it manually by
the properties.
The speed is good and so we'll use most likely that way for facetting our
properties in our application.
On Friday, December 9, 2011 12:13:43 PM UTC+1, maik wrote:
Yes, but this only results in something like that:
facets : [
"capacity": 100,
"speed": 150
]
There is no connection to the value, and this is needed.
I helped me out in a way i don't like:
properties : ["capacity###4 GB", "speed###32 MB/s"]
A facet on the properties field results like this:
facets: [
"capacity###4 GB" : 30,
"capacity###8 GB" : 20,
"speed###16 MB/s": 10,
"speed###32 MB/s" : 40
]
I have to split the properties and values in the application with the
split-argument "###".
Thats not very fast.
We currently have more than 2000 (and counting) properties in our db. Is
this ok to add all of them to mapping?
On Sunday, June 3, 2012 1:59:04 PM UTC+4, kimchy wrote:
I meant using the get mapping API to get the list of relevant fields you
might care about when you facet...
On Fri, Jun 1, 2012 at 9:06 AM, Rauan Maemirov <raua...@gmail.com<javascript:>
wrote:
Hi, Shay. I'm trying to implement the same scheme as topicstarter.
I didn't understand what do you mean by 'automatically generate facets
for all the properly names assuming they are used as field names'.
Should I directly define mapping for every property in properties list I
have? But what if there are dynamic? I.e. in first document the properties
are {color: 'black', size: 'XL'}, in the second are {capacity: '2Gb',
generation: '5'}, etc. (and there may be a lot of types of product,so
different document types is not a desirable solution)
понедельник, 12 декабря 2011 г., 19:08:15 UTC+6 пользователь kimchy
написал:
Since we have the mapping information, we might be able to do this, i.e.
automatically generate facets for all the properly names assuming they are
used as field names. But, you can also do it yourself, you can ask for the
mapping, it will include all the fields names options, and build the facets
request based on that. (note, the properly names will need to be fields in
the document).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.