# Social Search?

**URL:** https://discuss.elastic.co/t/social-search/6053
**Category:** Elasticsearch
**Created:** [December 2, 2011, 3:39pm UTC](https://discuss.elastic.co/t/social-search/6053 "2011-12-02T15:39:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Benoit\_Domingue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benoit_domingue/32/3051_2.png) [@Benoit\_Domingue](https://discuss.elastic.co/u/Benoit_Domingue)
#### Post date: [December 2, 2011, 3:39pm UTC](https://discuss.elastic.co/t/social-search/6053/1 "2011-12-02T15:39:04Z")

</div>

Hello,

I'm kinda new to elasticsearch, but so far, it's been a really good  
ride ! 🙂

Now I i'd like to boost results that according to a social graph...  
For example, if some content is from my friend or my friend's friend,  
I'd like to boost it.

How would that be possible using elasticsearch ?

Would I need an index for each users ?  
How would you guys set the mapping ?

Thanks a lot !

---

<div class="post-metadata">

### Author: ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)
#### Post date: [December 2, 2011, 3:47pm UTC](https://discuss.elastic.co/t/social-search/6053/2 "2011-12-02T15:47:41Z")

</div>

that sounds like possibly a custom score:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

But be careful, friends of friends can become pretty big pretty quick 😃

On Fri, Dec 2, 2011 at 7:39 AM, Benoit Domingue [bedingue@gmail.com](mailto:bedingue@gmail.com) wrote:

> Hello,
> 
> I'm kinda new to elasticsearch, but so far, it's been a really good  
> ride ! 🙂
> 
> Now I i'd like to boost results that according to a social graph...  
> For example, if some content is from my friend or my friend's friend,  
> I'd like to boost it.
> 
> How would that be possible using elasticsearch ?
> 
> Would I need an index for each users ?  
> How would you guys set the mapping ?
> 
> Thanks a lot !

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

### Author: ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)
#### Post date: [December 2, 2011, 8:40pm UTC](https://discuss.elastic.co/t/social-search/6053/3 "2011-12-02T20:40:31Z")

</div>

Either attack that via custom score or a filter query which includes  
all friend and friends of friends. For jetslide / jetwick(open source)  
I've implemented this that way.

But as Paul noted this can become quite big. A solution would be to  
attach a marker array "forUsers" to every document. This way you have  
hopefully less big arrays in the documents and one a simple term  
filter while searching. You could also do some boosting e.g. add  
"twitterUserName":9 to the document and then do a sort or boost  
against that field...

Regards,  
Peter.

On 2 Dez., 16:47, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:

> that sounds like possibly a custom score:[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-q)...
> 
> But be careful, friends of friends can become pretty big pretty quick 😃
> 
> On Fri, Dec 2, 2011 at 7:39 AM, Benoit Domingue [bedin...@gmail.com](mailto:bedin...@gmail.com) wrote:
> 
> > Hello,
> 
> > I'm kinda new to elasticsearch, but so far, it's been a really good  
> > ride ! 🙂
> 
> > Now I i'd like to boost results that according to a social graph...  
> > For example, if some content is from my friend or my friend's friend,  
> > I'd like to boost it.
> 
> > How would that be possible using elasticsearch ?
> 
> > Would I need an index for each users ?  
> > How would you guys set the mapping ?
> 
> > Thanks a lot !
> 
> ## --
> 
> Paul Loy  
> p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

---

<div class="post-metadata">

### Author: ![Benoit\_Domingue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benoit_domingue/32/3051_2.png) [@Benoit\_Domingue](https://discuss.elastic.co/u/Benoit_Domingue)
#### Post date: [December 7, 2011, 4:20pm UTC](https://discuss.elastic.co/t/social-search/6053/4 "2011-12-07T16:20:03Z")

</div>

Thanks a lot for both replies! 🙂

It's still kinda fuzzy for me...  
The documentation also talks about a different approach,  
one where there would be an index for each of users.  
Do you guys know what would be indexed in there ?  
Only user's friends or also user generated content ?  
([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-)  
query.html)

Thanks again for your help.

On Dec 2, 3:40 pm, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:

> Either attack that via custom score or a filter query which includes  
> all friend and friends of friends. For jetslide / jetwick(open source)  
> I've implemented this that way.
> 
> But as Paul noted this can become quite big. A solution would be to  
> attach a marker array "forUsers" to every document. This way you have  
> hopefully less big arrays in the documents and one a simple term  
> filter while searching. You could also do some boosting e.g. add  
> "twitterUserName":9 to the document and then do a sort or boost  
> against that field...
> 
> Regards,  
> Peter.
> 
> On 2 Dez., 16:47, Paul Loy [ketera...@gmail.com](mailto:ketera...@gmail.com) wrote:
> 
> > that sounds like possibly a custom score:[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-q)...
> 
> > But be careful, friends of friends can become pretty big pretty quick 😃
> 
> > On Fri, Dec 2, 2011 at 7:39 AM, Benoit Domingue [bedin...@gmail.com](mailto:bedin...@gmail.com) wrote:
> > 
> > > Hello,
> 
> > > I'm kinda new to elasticsearch, but so far, it's been a really good  
> > > ride ! 🙂
> 
> > > Now I i'd like to boost results that according to asocialgraph...  
> > > For example, if some content is from my friend or my friend's friend,  
> > > I'd like to boost it.
> 
> > > How would that be possible using elasticsearch ?
> 
> > > Would I need an index for each users ?  
> > > How would you guys set the mapping ?
> 
> > > Thanks a lot !
> 
> > ## --
> > 
> > Paul Loy  
> > p...@keteracel.comhttp://uk.linkedin.com/in/paulloy

---

<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, 3:46am UTC](https://discuss.elastic.co/t/social-search/6053/5 "2017-07-06T03:46:09Z")

</div>


