# How did soundcloud.com build their search?

**URL:** <https://discuss.elastic.co/t/how-did-soundcloud-com-build-their-search/13575>\
**Category:** Elasticsearch\
**Created:** [September 12, 2013, 7:03pm UTC](https://discuss.elastic.co/t/how-did-soundcloud-com-build-their-search/13575 "2013-09-12T19:03:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joa/32/1807_2.png) [@joa](https://discuss.elastic.co/u/joa)\
**Post date:** [September 12, 2013, 7:03pm UTC](https://discuss.elastic.co/t/how-did-soundcloud-com-build-their-search/13575/1 "2013-09-12T19:03:18Z")

</div>

The [soundcloud.com](http://soundcloud.com) search seems to be an auto suggest search over multiple  
fields, maybe over multiple types/indeces.

Example call with suggestions for "aa":  
[https://api.soundcloud.com/search/suggest?q=aa&pretty=true](https://api.soundcloud.com/search/suggest?q=aa&pretty=true)

{  
"tx\_id" : "47f7ce51ad784cc98fe8f1201729fb87",  
"query\_time\_in\_millis" : 0,  
"query" : "aa",  
"limit" : 3,  
"suggestions" : [ {  
"query" : " **A$** AP Rocky",  
"kind" : "user",  
"id" : 26482329,  
"score" : 165994  
}, {  
"query" : " **A$** AP Rocky, F\*\*kin' Problems (ft. Drake, 2 Chainz & Kendrick Lamar)",  
"kind" : "track",  
"id" : 64506899,  
"score" : 97811  
}, {  
"query" : " **A$** AP Rocky, Wild For The Night",  
"kind" : "track",  
"id" : 74570738,  
"score" : 64564  
} ]  
}

How to build an auto suggest function that works for multiple fields in  
general? And how did they include a "kind" field in the result, to  
determine where the hit comes from?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 13, 2013, 7:03am UTC](https://discuss.elastic.co/t/how-did-soundcloud-com-build-their-search/13575/2 "2013-09-13T07:03:50Z")

</div>

Hey,

you may want to checkout the completion suggester, which allows you also to  
add custom content to return by using payloads.  
Also from my high level point of view, it merely looks like they are  
maintaining an own suggest index instead of querying many others... (dont  
know internals though)

See

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--Alex

On Thu, Sep 12, 2013 at 9:03 PM, joa [joafeldmann@gmail.com](mailto:joafeldmann@gmail.com) wrote:

> The [soundcloud.com](http://soundcloud.com) search seems to be an auto suggest search over  
> multiple fields, maybe over multiple types/indeces.
> 
> Example call with suggestions for "aa":  
> [https://api.soundcloud.com/search/suggest?q=aa&pretty=true](https://api.soundcloud.com/search/suggest?q=aa&pretty=true)
> 
> {  
> "tx\_id" : "47f7ce51ad784cc98fe8f1201729fb87",  
> "query\_time\_in\_millis" : 0,  
> "query" : "aa",  
> "limit" : 3,  
> "suggestions" : [ {  
> "query" : " **A$** AP Rocky",  
> "kind" : "user",  
> "id" : 26482329,  
> "score" : 165994  
> }, {  
> "query" : " **A$** AP Rocky, F\*\*kin' Problems (ft. Drake, 2 Chainz & Kendrick Lamar)",  
> "kind" : "track",  
> "id" : 64506899,  
> "score" : 97811  
> }, {  
> "query" : " **A$** AP Rocky, Wild For The Night",  
> "kind" : "track",  
> "id" : 74570738,  
> "score" : 64564  
> } ]  
> }
> 
> How to build an auto suggest function that works for multiple fields in  
> general? And how did they include a "kind" field in the result, to  
> determine where the hit comes from?
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![ddorian43](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ddorian43/32/36093_2.png) [@ddorian43](https://discuss.elastic.co/u/ddorian43)\
**Post date:** [September 13, 2013, 2:28pm UTC](https://discuss.elastic.co/t/how-did-soundcloud-com-build-their-search/13575/3 "2013-09-13T14:28:01Z")

</div>

[http://backstage.soundcloud.com/tag/elastic-search/](http://backstage.soundcloud.com/tag/elastic-search/)

On Thursday, September 12, 2013 9:03:18 PM UTC+2, joa wrote:

> The [soundcloud.com](http://soundcloud.com) search seems to be an auto suggest search over  
> multiple fields, maybe over multiple types/indeces.
> 
> Example call with suggestions for "aa":  
> [https://api.soundcloud.com/search/suggest?q=aa&pretty=true](https://api.soundcloud.com/search/suggest?q=aa&pretty=true)
> 
> {  
> "tx\_id" : "47f7ce51ad784cc98fe8f1201729fb87",  
> "query\_time\_in\_millis" : 0,  
> "query" : "aa",  
> "limit" : 3,  
> "suggestions" : [ {  
> "query" : " **A$** AP Rocky",  
> "kind" : "user",  
> "id" : 26482329,  
> "score" : 165994  
> }, {  
> "query" : " **A$** AP Rocky, F\*\*kin' Problems (ft. Drake, 2 Chainz & Kendrick Lamar)",  
> "kind" : "track",  
> "id" : 64506899,  
> "score" : 97811  
> }, {  
> "query" : " **A$** AP Rocky, Wild For The Night",  
> "kind" : "track",  
> "id" : 74570738,  
> "score" : 64564  
> } ]  
> }
> 
> How to build an auto suggest function that works for multiple fields in  
> general? And how did they include a "kind" field in the result, to  
> determine where the hit comes from?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![joa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joa/32/1807_2.png) [@joa](https://discuss.elastic.co/u/joa)\
**Post date:** [September 20, 2013, 12:55pm UTC](https://discuss.elastic.co/t/how-did-soundcloud-com-build-their-search/13575/4 "2013-09-20T12:55:19Z")

</div>

@ddorian43: Thanks, I've already read their blog, but it has no ES  
internals.  
@Alexander: Your guess was right, they're using an own suggest index. I've  
posted my question to their blog and their answer came today:

The auto-suggest feature is totally disconnected from Elasticsearch. We

> build a finite state transducer (FST) containing the most relevant of each  
> entity-type offline, and serve it from memory. The technique we use is  
> very similar to the one described here:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> 
> ...and if we were building the feature today, I think we would definitely  
> try first to do it with that API.

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:15am UTC](https://discuss.elastic.co/t/how-did-soundcloud-com-build-their-search/13575/5 "2017-07-06T02:15:22Z")

</div>


