I started to use faceted search with elastic and it works quite well and
fast, but it always fails if I try to use Terms facet with a script field
that is pointing to property which depth is more than 1 level deep. (for
example _source.prop.prop1)
It is only fails if the query resultset has at least 1 document that does
not have that property I'm looking for. So for example if I'm looking for
_source.prop.prop1 then it fails if I have at least one document that don't
have the _source.prop.prop1 property in the resultset.
I think correctly the faceted search should skip those documents that does
not have the faceted property and it should not throw a PropertyAccessException[[Error:
could not access: prop; exeception, which happens if the property depth is
1.
For example this query fails:
{"query":{"query_string":{"query":"*"}},"facets":{"termStatFacet":{"terms":{"size":500,"script":"_source.prop.prop1"}}}}'
But this query not:
{"query":{"query_string":{"query":"*"}},"facets":{"termStatFacet":{"terms":{"size":500,"script":"_source.testProperty"}}}}
However the first query won't fail if I use a query that matches on every
document that has a property I'm using in term facet :
{"query":{"query_string":{"query":"prop.prop1:*"}},"facets":{"termStatFacet":{"terms":{"size":500,"script":"_source.prop.prop1"}}}}'
mvel support null value property navigation using the .? syntax, here is
how it should look like: curl -XGET http://localhost:9200/twitter/tweet/_search -d
'{"query":{"query_string":{"query":"*"}},"facets":{"termStatFacet":{"terms":{"size":500,"script":"_source.?prop.?prop1"}}}}'.
Note, faceting on _source means that for each hit that matches the query,
the _source will be loaded and parsed, using doc prefix usually makes more
sense.
I started to use faceted search with elastic and it works quite well and
fast, but it always fails if I try to use Terms facet with a script field
that is pointing to property which depth is more than 1 level deep. (for
example _source.prop.prop1)
It is only fails if the query resultset has at least 1 document that does
not have that property I'm looking for. So for example if I'm looking for
_source.prop.prop1 then it fails if I have at least one document that don't
have the _source.prop.prop1 property in the resultset.
I think correctly the faceted search should skip those documents that does
not have the faceted property and it should not throw a PropertyAccessException[[Error:
could not access: prop; exeception, which happens if the property depth is
1.
Thanks Shay for the answer.
My soulution was adding an exist filter for the requested property to the
facet query.
What do you mean on doc prefix?
I used _source because for example for "Acme Institute" I wanted to get
back as "Acme Institute" and not as "Acme" and "Institute" however when I'm
doing search I wanted to be searchable with "Acme" and "Institue" so I
couldn't use Keyword analyzer for the expression.
Thanks,
Tamas
On Thursday, May 24, 2012 12:46:46 AM UTC+2, kimchy wrote:
mvel support null value property navigation using the .? syntax, here is
how it should look like: curl -XGET http://localhost:9200/twitter/tweet/_search -d
'{"query":{"query_string":{"query":"*"}},"facets":{"termStatFacet":{"terms":{"size":500,"script":"_source.?prop.?prop1"}}}}'.
Note, faceting on _source means that for each hit that matches the query,
the _source will be loaded and parsed, using doc prefix usually makes more
sense.
I started to use faceted search with elastic and it works quite well and
fast, but it always fails if I try to use Terms facet with a script field
that is pointing to property which depth is more than 1 level deep. (for
example _source.prop.prop1)
It is only fails if the query resultset has at least 1 document that does
not have that property I'm looking for. So for example if I'm looking for
_source.prop.prop1 then it fails if I have at least one document that don't
have the _source.prop.prop1 property in the resultset.
I think correctly the faceted search should skip those documents that
does not have the faceted property and it should not throw a PropertyAccessException[[Error:
could not access: prop; exeception, which happens if the property depth is
1.
On Thursday, May 24, 2012 12:46:46 AM UTC+2, kimchy wrote:
mvel support null value property navigation using the .? syntax, here is
how it should look like: curl -XGET http://localhost:9200/twitter/tweet/_search -d
'{"query":{"query_string":{"query":"*"}},"facets":{"termStatFacet":{"terms":{"size":500,"script":"_source.?prop.?prop1"}}}}'.
Note, faceting on _source means that for each hit that matches the query,
the _source will be loaded and parsed, using doc prefix usually makes more
sense.
I started to use faceted search with elastic and it works quite well and
fast, but it always fails if I try to use Terms facet with a script field
that is pointing to property which depth is more than 1 level deep. (for
example _source.prop.prop1)
It is only fails if the query resultset has at least 1 document that does
not have that property I'm looking for. So for example if I'm looking for
_source.prop.prop1 then it fails if I have at least one document that don't
have the _source.prop.prop1 property in the resultset.
I think correctly the faceted search should skip those documents that
does not have the faceted property and it should not throw a PropertyAccessException[[Error:
could not access: prop; exeception, which happens if the property depth is
1.
On Thursday, May 24, 2012 12:46:46 AM UTC+2, kimchy wrote:
mvel support null value property navigation using the .? syntax, here is
how it should look like: curl -XGET http://localhost:9200/twitter/tweet/_search -d
'{"query":{"query_string":{"query":"*"}},"facets":{"termStatFacet":{"terms":{"size":500,"script":"_source.?prop.?prop1"}}}}'.
Note, faceting on _source means that for each hit that matches the query,
the _source will be loaded and parsed, using doc prefix usually makes more
sense.
I started to use faceted search with elastic and it works quite well and
fast, but it always fails if I try to use Terms facet with a script field
that is pointing to property which depth is more than 1 level deep. (for
example _source.prop.prop1)
It is only fails if the query resultset has at least 1 document that does
not have that property I'm looking for. So for example if I'm looking for
_source.prop.prop1 then it fails if I have at least one document that don't
have the _source.prop.prop1 property in the resultset.
I think correctly the faceted search should skip those documents that
does not have the faceted property and it should not throw a PropertyAccessException[[Error:
could not access: prop; exeception, which happens if the property depth is
1.
_source ends up loading each json doc and parsing it, doc will preload all
the data to memory and make accessing it considerably faster. You can map
the field as not analyzed and then use doc on that field, which will give
you the content without it being broken down to terms. You can also use
multi field mapping to have one version analyzed, and one that is not.
Thanks Shay for the answer.
My soulution was adding an exist filter for the requested property to the
facet query.
What do you mean on doc prefix?
I used _source because for example for "Acme Institute" I wanted to get
back as "Acme Institute" and not as "Acme" and "Institute" however when I'm
doing search I wanted to be searchable with "Acme" and "Institue" so I
couldn't use Keyword analyzer for the expression.
Thanks,
Tamas
On Thursday, May 24, 2012 12:46:46 AM UTC+2, kimchy wrote:
mvel support null value property navigation using the .? syntax, here is
how it should look like: curl -XGET http://localhost:9200/twitter/**
tweet/_search http://localhost:9200/twitter/tweet/_search -d
'{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.?
prop.?prop1"}}}}'.
Note, faceting on _source means that for each hit that matches the query,
the _source will be loaded and parsed, using doc prefix usually makes more
sense.
I started to use faceted search with elastic and it works quite well and
fast, but it always fails if I try to use Terms facet with a script field
that is pointing to property which depth is more than 1 level deep. (for
example _source.prop.prop1)
It is only fails if the query resultset has at least 1 document that
does not have that property I'm looking for. So for example if I'm looking
for _source.prop.prop1 then it fails if I have at least one document that
don't have the _source.prop.prop1 property in the resultset.
I think correctly the faceted search should skip those documents that
does not have the faceted property and it should not throw a
PropertyAccessException[[**Error: could not access: prop; exeception,
which happens if the property depth is 1.
For example this query fails:
{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.
prop.prop1"}}}}'
But this query not:
{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.
testProperty"}}}}
However the first query won't fail if I use a query that matches on
every document that has a property I'm using in term facet :
{"query":{"query_string":{"query":"prop.prop1:*"}},"
facets":{"termStatFacet":{"terms":{"size":500,"script":"_
source.prop.prop1"}}}}'
On Thursday, May 24, 2012 12:46:46 AM UTC+2, kimchy wrote:
mvel support null value property navigation using the .? syntax, here is
how it should look like: curl -XGET http://localhost:9200/twitter/**
tweet/_search http://localhost:9200/twitter/tweet/_search -d
'{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.?
prop.?prop1"}}}}'.
Note, faceting on _source means that for each hit that matches the query,
the _source will be loaded and parsed, using doc prefix usually makes more
sense.
I started to use faceted search with elastic and it works quite well and
fast, but it always fails if I try to use Terms facet with a script field
that is pointing to property which depth is more than 1 level deep. (for
example _source.prop.prop1)
It is only fails if the query resultset has at least 1 document that
does not have that property I'm looking for. So for example if I'm looking
for _source.prop.prop1 then it fails if I have at least one document that
don't have the _source.prop.prop1 property in the resultset.
I think correctly the faceted search should skip those documents that
does not have the faceted property and it should not throw a
PropertyAccessException[[**Error: could not access: prop; exeception,
which happens if the property depth is 1.
For example this query fails:
{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.
prop.prop1"}}}}'
But this query not:
{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.
testProperty"}}}}
However the first query won't fail if I use a query that matches on
every document that has a property I'm using in term facet :
{"query":{"query_string":{"query":"prop.prop1:*"}},"
facets":{"termStatFacet":{"terms":{"size":500,"script":"_
source.prop.prop1"}}}}'
On Thursday, May 24, 2012 12:46:46 AM UTC+2, kimchy wrote:
mvel support null value property navigation using the .? syntax, here is
how it should look like: curl -XGET http://localhost:9200/twitter/**
tweet/_search http://localhost:9200/twitter/tweet/_search -d
'{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.?
prop.?prop1"}}}}'.
Note, faceting on _source means that for each hit that matches the query,
the _source will be loaded and parsed, using doc prefix usually makes more
sense.
I started to use faceted search with elastic and it works quite well and
fast, but it always fails if I try to use Terms facet with a script field
that is pointing to property which depth is more than 1 level deep. (for
example _source.prop.prop1)
It is only fails if the query resultset has at least 1 document that
does not have that property I'm looking for. So for example if I'm looking
for _source.prop.prop1 then it fails if I have at least one document that
don't have the _source.prop.prop1 property in the resultset.
I think correctly the faceted search should skip those documents that
does not have the faceted property and it should not throw a
PropertyAccessException[[**Error: could not access: prop; exeception,
which happens if the property depth is 1.
For example this query fails:
{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.
prop.prop1"}}}}'
But this query not:
{"query":{"query_string":{"query":"*"}},"facets":{"
termStatFacet":{"terms":{"size":500,"script":"_source.
testProperty"}}}}
However the first query won't fail if I use a query that matches on
every document that has a property I'm using in term facet :
{"query":{"query_string":{"query":"prop.prop1:*"}},"
facets":{"termStatFacet":{"terms":{"size":500,"script":"_
source.prop.prop1"}}}}'
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.