Different field according to categories

Hi,

im trying to use elasticsearch to search through products. If product is a
car for instance, it will have some field like "color", "brand", "model",
"km", ...
If it is clothes, it will only have "color", "size", ...
I would like to index all this info in elastic to be able then to search
cars with km between aaa km and bbb km, and / or xxxx model, same for
clothes or any other products.

how can I create such field(s) in elasticsearch ? I want all products to be
in same index, so user can search through all products, but also if user
search a type a product, then he should be able to specify some more
details according to this kind of product.

I was thinking about array field, but does that mean that all products will
have all fields corresponding to all type of products even if some fields
are not relevant with some products (ie clothes will have km field ??) ? Or
is it possible on indexing to put just info needed corresponding to each
product ?

thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

simply create different types for each kind of product in one index. Still
your application will need to fire off different kind of searches depending
on the product you are searching for.

Also check out this presentation from Clinton to get up and running
quickly, along with the reference documentation.

--Alex

On Mon, Jun 24, 2013 at 9:18 PM, oto iashvili
optimum.dulopin@laposte.netwrote:

Hi,

im trying to use elasticsearch to search through products. If product is a
car for instance, it will have some field like "color", "brand", "model",
"km", ...
If it is clothes, it will only have "color", "size", ...
I would like to index all this info in elastic to be able then to search
cars with km between aaa km and bbb km, and / or xxxx model, same for
clothes or any other products.

how can I create such field(s) in elasticsearch ? I want all products to
be in same index, so user can search through all products, but also if user
search a type a product, then he should be able to specify some more
details according to this kind of product.

I was thinking about array field, but does that mean that all products
will have all fields corresponding to all type of products even if some
fields are not relevant with some products (ie clothes will have km field
??) ? Or is it possible on indexing to put just info needed corresponding
to each product ?

thanks

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

thanks for answer. It seems to be what I need. But Is there a way to
optimize or to make kind of inheritance, as all products have some common
fields, like price, category, date, images, ...

On Monday, June 24, 2013 10:22:01 PM UTC+2, Alexander Reelsen wrote:

Hey,

simply create different types for each kind of product in one index. Still
your application will need to fire off different kind of searches depending
on the product you are searching for.

Also check out this presentation from Clinton to get up and running
quickly, along with the reference documentation.
Down and dirty with Elasticsearch | PPT

--Alex

On Mon, Jun 24, 2013 at 9:18 PM, oto iashvili <optimum...@laposte.net<javascript:>

wrote:

Hi,

im trying to use elasticsearch to search through products. If product is
a car for instance, it will have some field like "color", "brand", "model",
"km", ...
If it is clothes, it will only have "color", "size", ...
I would like to index all this info in elastic to be able then to search
cars with km between aaa km and bbb km, and / or xxxx model, same for
clothes or any other products.

how can I create such field(s) in elasticsearch ? I want all products to
be in same index, so user can search through all products, but also if user
search a type a product, then he should be able to specify some more
details according to this kind of product.

I was thinking about array field, but does that mean that all products
will have all fields corresponding to all type of products even if some
fields are not relevant with some products (ie clothes will have km field
??) ? Or is it possible on indexing to put just info needed corresponding
to each product ?

thanks

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

you can configure a default settings for all types created in your search
instance (I am however not a big fan of it, but maybe it helps in your
specific usecase). See

--Alex

On Tue, Jun 25, 2013 at 3:14 PM, oto iashvili
optimum.dulopin@laposte.netwrote:

thanks for answer. It seems to be what I need. But Is there a way to
optimize or to make kind of inheritance, as all products have some common
fields, like price, category, date, images, ...

On Monday, June 24, 2013 10:22:01 PM UTC+2, Alexander Reelsen wrote:

Hey,

simply create different types for each kind of product in one index.
Still your application will need to fire off different kind of searches
depending on the product you are searching for.

Also check out this presentation from Clinton to get up and running
quickly, along with the reference documentation.
http://www.slideshare.net/**clintongormley/down-and-dirty-**
with-elasticsearchhttp://www.slideshare.net/clintongormley/down-and-dirty-with-elasticsearch

--Alex

On Mon, Jun 24, 2013 at 9:18 PM, oto iashvili optimum...@laposte.netwrote:

Hi,

im trying to use elasticsearch to search through products. If product is
a car for instance, it will have some field like "color", "brand", "model",
"km", ...
If it is clothes, it will only have "color", "size", ...
I would like to index all this info in elastic to be able then to search
cars with km between aaa km and bbb km, and / or xxxx model, same for
clothes or any other products.

how can I create such field(s) in elasticsearch ? I want all products to
be in same index, so user can search through all products, but also if user
search a type a product, then he should be able to specify some more
details according to this kind of product.

I was thinking about array field, but does that mean that all products
will have all fields corresponding to all type of products even if some
fields are not relevant with some products (ie clothes will have km field
??) ? Or is it possible on indexing to put just info needed corresponding
to each product ?

thanks

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

thanks. that is exacty what I was searching.
On some other forum, someone told me it is also possible to do this by
creating different types. Do u know if one solution is better (quicklier,
easyer, ...) that the other ?

On Wednesday, June 26, 2013 8:33:47 AM UTC+2, Alexander Reelsen wrote:

Hey,

you can configure a default settings for all types created in your search
instance (I am however not a big fan of it, but maybe it helps in your
specific usecase). See
Elasticsearch Platform — Find real-time answers at scale | Elastic

--Alex

On Tue, Jun 25, 2013 at 3:14 PM, oto iashvili <optimum...@laposte.net<javascript:>

wrote:

thanks for answer. It seems to be what I need. But Is there a way to
optimize or to make kind of inheritance, as all products have some common
fields, like price, category, date, images, ...

On Monday, June 24, 2013 10:22:01 PM UTC+2, Alexander Reelsen wrote:

Hey,

simply create different types for each kind of product in one index.
Still your application will need to fire off different kind of searches
depending on the product you are searching for.

Also check out this presentation from Clinton to get up and running
quickly, along with the reference documentation.
http://www.slideshare.net/**clintongormley/down-and-dirty-**
with-elasticsearchhttp://www.slideshare.net/clintongormley/down-and-dirty-with-elasticsearch

--Alex

On Mon, Jun 24, 2013 at 9:18 PM, oto iashvili optimum...@laposte.netwrote:

Hi,

im trying to use elasticsearch to search through products. If product
is a car for instance, it will have some field like "color", "brand",
"model", "km", ...
If it is clothes, it will only have "color", "size", ...
I would like to index all this info in elastic to be able then to
search cars with km between aaa km and bbb km, and / or xxxx model, same
for clothes or any other products.

how can I create such field(s) in elasticsearch ? I want all products
to be in same index, so user can search through all products, but also if
user search a type a product, then he should be able to specify some more
details according to this kind of product.

I was thinking about array field, but does that mean that all products
will have all fields corresponding to all type of products even if some
fields are not relevant with some products (ie clothes will have km field
??) ? Or is it possible on indexing to put just info needed corresponding
to each product ?

thanks

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.