# Documentation about elasticsearch internals

**URL:** <https://discuss.elastic.co/t/documentation-about-elasticsearch-internals/5753>\
**Category:** Elasticsearch\
**Created:** [November 2, 2011, 11:35pm UTC](https://discuss.elastic.co/t/documentation-about-elasticsearch-internals/5753 "2011-11-02T23:35:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Reelsen](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexander\_Reelsen](https://discuss.elastic.co/u/Alexander_Reelsen)\
**Post date:** [November 2, 2011, 11:35pm UTC](https://discuss.elastic.co/t/documentation-about-elasticsearch-internals/5753/1 "2011-11-02T23:35:34Z")

</div>

Hi there,

I am currently wading a bit through the sources and struggling a bit.  
Is there some API documentation or some low level plugins available? I  
would like to access the lucene indexreader and playing a bit around  
with the fst suggester.

Any documentation or source code hints (services I could inject,  
classes doing something similar) are greatly appreciated. Thanks!

--Alexander

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 3, 2011, 5:35pm UTC](https://discuss.elastic.co/t/documentation-about-elasticsearch-internals/5753/2 "2011-11-03T17:35:02Z")

</div>

Its kind of hard..., as its such open ended question.

On Thu, Nov 3, 2011 at 1:35 AM, Alexander Reelsen \<  
[alexander.reelsen@googlemail.com](mailto:alexander.reelsen@googlemail.com)\> wrote:

> Hi there,
> 
> I am currently wading a bit through the sources and struggling a bit.  
> Is there some API documentation or some low level plugins available? I  
> would like to access the lucene indexreader and playing a bit around  
> with the fst suggester.
> 
> Any documentation or source code hints (services I could inject,  
> classes doing something similar) are greatly appreciated. Thanks!
> 
> --Alexander

---

<div class="post-metadata">

**Author:** ![Alexander\_Reelsen](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexander\_Reelsen](https://discuss.elastic.co/u/Alexander_Reelsen)\
**Post date:** [November 3, 2011, 9:11pm UTC](https://discuss.elastic.co/t/documentation-about-elasticsearch-internals/5753/3 "2011-11-03T21:11:14Z")

</div>

Hi Shay

On Nov 3, 6:35 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Its kind of hard..., as its such open ended question.  
> True. Would have asked more exactly if I knew more I guess - I am  
> going to read some sources over the weekend I guess.

What I would like to do, is to use the lucene fst suggester, and  
implement a restcontroller on top of that (for which there is a  
wonderful working documentation in the blog). The correct way for this  
would possibly to patch the Client interface and to add a  
SuggestRequest (does this also mean there is no chance to have it as  
an external plugin?). This means also to implement the correct Action  
in order to have the same behaviour like for example a SearchRequest.

The quick and dirty way would possibly be to simply get an lucene  
indexreader and fire off the suggester on top of that (does not scale,  
does not support multiple shards, but works in my case and works until  
I understand more of ES :-).

So my question would be: How to get an indexreader in a restcontroller  
without implementing the whole layers in order to be fully compatible  
with ES?

About other code samples: I checked github for some plugins (not  
rivers), but there do not seem to exist any further modules for  
elasticsearch. If anyone knows some, please post.

Thanks and have a nice day!

--Alexander

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 8, 2011, 2:56am UTC](https://discuss.elastic.co/t/documentation-about-elasticsearch-internals/5753/4 "2011-11-08T02:56:58Z")

</div>

Thats not a simple feature to implemented. First, you need a component that  
would build the suggestions, since you can't build it for every request.  
Then, you need to have that component periodically refresh itself (which is  
why I am not a fan of it, it requires a full rebuild of it). The suggest  
service (shard level) can be injected with teh IndexShard to get a hold of  
an index reader.

Once that service is there (on the shard level), then an API (first,  
Java/transport level API) is needed to be exposed, and then build the REST  
API on top of it.

On Thu, Nov 3, 2011 at 11:11 PM, Alexander Reelsen \<  
[alexander.reelsen@googlemail.com](mailto:alexander.reelsen@googlemail.com)\> wrote:

> Hi Shay
> 
> On Nov 3, 6:35 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > Its kind of hard..., as its such open ended question.  
> > True. Would have asked more exactly if I knew more I guess - I am  
> > going to read some sources over the weekend I guess.
> 
> What I would like to do, is to use the lucene fst suggester, and  
> implement a restcontroller on top of that (for which there is a  
> wonderful working documentation in the blog). The correct way for this  
> would possibly to patch the Client interface and to add a  
> SuggestRequest (does this also mean there is no chance to have it as  
> an external plugin?). This means also to implement the correct Action  
> in order to have the same behaviour like for example a SearchRequest.
> 
> The quick and dirty way would possibly be to simply get an lucene  
> indexreader and fire off the suggester on top of that (does not scale,  
> does not support multiple shards, but works in my case and works until  
> I understand more of ES :-).
> 
> So my question would be: How to get an indexreader in a restcontroller  
> without implementing the whole layers in order to be fully compatible  
> with ES?
> 
> About other code samples: I checked github for some plugins (not  
> rivers), but there do not seem to exist any further modules for  
> elasticsearch. If anyone knows some, please post.
> 
> Thanks and have a nice day!
> 
> --Alexander

---

<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:49am UTC](https://discuss.elastic.co/t/documentation-about-elasticsearch-internals/5753/5 "2017-07-06T03:49:41Z")

</div>


