# Searching for Mentions Instead of Every Occurence

**URL:** <https://discuss.elastic.co/t/searching-for-mentions-instead-of-every-occurence/3585>\
**Category:** Elasticsearch\
**Created:** [November 18, 2010, 11:43am UTC](https://discuss.elastic.co/t/searching-for-mentions-instead-of-every-occurence/3585 "2010-11-18T11:43:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted\_Karmel](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Ted\_Karmel](https://discuss.elastic.co/u/Ted_Karmel)\
**Post date:** [November 18, 2010, 11:43am UTC](https://discuss.elastic.co/t/searching-for-mentions-instead-of-every-occurence/3585/1 "2010-11-18T11:43:01Z")

</div>

Hello Elasticsearchers,

I was wondering how to formulate a query to just get a single instance  
of a value as opposed to every instance.

Concretely, in keeping with the twitter and tweet case, the scenario  
would be when a user wants to search who s/he has mentioned in tweets.  
How many times the other user has been mentioned or the tweets where  
they were mentioned is not important. Is there a filter that could do  
this or do you have to parse through every search result and instance  
to derive this info?

Cheers,  
Ted

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [November 19, 2010, 1:17am UTC](https://discuss.elastic.co/t/searching-for-mentions-instead-of-every-occurence/3585/2 "2010-11-19T01:17:06Z")

</div>

Hey,  
I believe that your data needs be structured so that each tweet also  
stores who is mentioned in it.

Then you just need to facet on that field that holds the mentioned  
users.

Hope this helps,  
Paul

On Nov 18, 4:43 am, Ted Karmel [ted.kar...@gmail.com](mailto:ted.kar...@gmail.com) wrote:

> Hello Elasticsearchers,
> 
> I was wondering how to formulate a query to just get a single instance  
> of a value as opposed to every instance.
> 
> Concretely, in keeping with the twitter and tweet case, the scenario  
> would be when a user wants to search who s/he has mentioned in tweets.  
> How many times the other user has been mentioned or the tweets where  
> they were mentioned is not important. Is there a filter that could do  
> this or do you have to parse through every search result and instance  
> to derive this info?
> 
> Cheers,  
> Ted

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:16am UTC](https://discuss.elastic.co/t/searching-for-mentions-instead-of-every-occurence/3585/3 "2017-07-06T04:16:18Z")

</div>

Closed on July 6, 2017, 4:16am UTC


