Facet Query on Phrase


(Sumit Guptaa) #1

Hi all,

I am looking for facet on phrases.
suppose I have field text with value "abc xyz def" and "abc xyz ghi def"

i need some help to get facet count like "abc xyz"- count:"2" , "abc"-count:"2", "xyz"- count:"2", "def" - count:"2","ghi" -count:"1"....

Thanks

Regards,
Sumit Gupta


(Igor Motov) #2

Facets are working on tokens. So, you need to define analyzer that is going
to split your values into proper tokens. I don't quite understand your
requirements here though. Do you want to split your string values into
words and pairs of words? For example, would "xyz def" be a proper facet?

On Wednesday, April 18, 2012 4:53:08 AM UTC-4, Sumit Gupta wrote:

Hi all,

I am looking for facet on phrases.
suppose I have field text with value "abc xyz def" and "abc xyz ghi def"

i need some help to get facet count like "abc xyz"- count:"2" ,
"abc"-count:"2", "xyz"- count:"2", "def" - count:"2","ghi" -count:"1"....

Thanks

Regards,
Sumit Gupta

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Facet-Query-on-Phrase-tp3919427p3919427.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(Sumit Guptaa) #3

hi Igor Motov

i am new in elasticsearch so please can u give me one example for this implementation....it would be very helpful to me for understading...

i just only want suppose we have a index that has only one filed like message and the value is in message is "abc xyz def" and "abc xyz ghi def" and when we search for "abc xyz" we get the following result like
"abc xyz"- count:"2" , "abc"-count:"2", "xyz"- count:"2", "def" - count:"2","ghi" -count:"1"

thanx...
Regards
Sumit Gupta


(Igor Motov) #4

Sorry, it seems that I misunderstood your question then. I am afraid, what
you are trying to do is not possible with elasticsearch. In elasticsearch,
facets are computed on complete records, not on only on the parts that
matched.

On Friday, April 20, 2012 1:17:34 AM UTC-4, Sumit Gupta wrote:

hi Igor Motov

i am new in elasticsearch so please can u give me one example for this
implementation....it would be very helpful to me for understading...

i just only want suppose we have a index that has only one filed like
message and the value is in message is "abc xyz def" and "abc xyz ghi def"
and when we search for "abc xyz" we get the following result like
"abc xyz"- count:"2" , "abc"-count:"2", "xyz"- count:"2", "def" -
count:"2","ghi" -count:"1"

thanx...
Regards
Sumit Gupta

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Facet-Query-on-Phrase-tp3919427p3925174.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(pulkitsinghal) #5

I agree with Igor but I wonder it is possible to change the indexing
approach? You can write a script that takes your document field and then
breaks down and stores the string "abc def abc hij" into a temporary new
index where you PUT each word as a new document and then do your search on
that new temporary index?

On Fri, Apr 20, 2012 at 5:26 AM, Igor Motov imotov@gmail.com wrote:

Sorry, it seems that I misunderstood your question then. I am afraid, what
you are trying to do is not possible with elasticsearch. In elasticsearch,
facets are computed on complete records, not on only on the parts that
matched.

On Friday, April 20, 2012 1:17:34 AM UTC-4, Sumit Gupta wrote:

hi Igor Motov

i am new in elasticsearch so please can u give me one example for this
implementation....it would be very helpful to me for understading...

i just only want suppose we have a index that has only one filed like
message and the value is in message is "abc xyz def" and "abc xyz ghi
def"
and when we search for "abc xyz" we get the following result like
"abc xyz"- count:"2" , "abc"-count:"2", "xyz"- count:"2", "def" -
count:"2","ghi" -count:"1"

thanx...
Regards
Sumit Gupta

--
View this message in context: http://elasticsearch-users.**
115913.n3.nabble.com/Facet-**Query-on-Phrase-**tp3919427p3925174.htmlhttp://elasticsearch-users.115913.n3.nabble.com/Facet-Query-on-Phrase-tp3919427p3925174.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #6