# Source Code Index using ES

**URL:** <https://discuss.elastic.co/t/source-code-index-using-es/17874>\
**Category:** Elasticsearch\
**Created:** [June 3, 2014, 6:43am UTC](https://discuss.elastic.co/t/source-code-index-using-es/17874 "2014-06-03T06:43:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sivakumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sivakumar/32/1412_2.png) [@Sivakumar](https://discuss.elastic.co/u/Sivakumar)\
**Post date:** [June 3, 2014, 6:43am UTC](https://discuss.elastic.co/t/source-code-index-using-es/17874/1 "2014-06-03T06:43:11Z")

</div>

Hi ,

We have indexed 1000+ source files using elastic search .

While searching any code/string we can get proper result .

_But we have 2 major problem ._

1 ) Code Snippet/ fragments - In result page will be shown only based on  
character instead of lines ( result page would be fixed line numbers like 5  
line for every snippet )

2 ) We cant get line numbers - we have added line number while indexing  
source file - but we cant get it .

Is it possible to fix this issue using elastic search ?

Please let us know your suggestion .

Thanks,  
Sivakumar.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/01028f2f-159a-45f2-838c-d93fa7ca42a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/01028f2f-159a-45f2-838c-d93fa7ca42a0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 3, 2014, 6:54am UTC](https://discuss.elastic.co/t/source-code-index-using-es/17874/2 "2014-06-03T06:54:33Z")

</div>

About line numbers, you could either do it on a client level or index lines if you want to retrieve lines.

Just like indexing a book. If you need to give as a result a page (think page number), it means that you need to index pages not the book!

My 2 cents.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 juin 2014 à 08:43, Sivakumar [85siva@gmail.com](mailto:85siva@gmail.com) a écrit :

Hi ,

We have indexed 1000+ source files using elastic search .

While searching any code/string we can get proper result .

But we have 2 major problem .

1 ) Code Snippet/ fragments - In result page will be shown only based on character instead of lines ( result page would be fixed line numbers like 5 line for every snippet )

2 ) We cant get line numbers - we have added line number while indexing source file - but we cant get it .

Is it possible to fix this issue using elastic search ?

Please let us know your suggestion .

Thanks,  
Sivakumar.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/01028f2f-159a-45f2-838c-d93fa7ca42a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/01028f2f-159a-45f2-838c-d93fa7ca42a0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5829A584-4FB2-4517-B607-94184D5D757E%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/5829A584-4FB2-4517-B607-94184D5D757E%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:25am UTC](https://discuss.elastic.co/t/source-code-index-using-es/17874/3 "2017-07-06T01:25:06Z")

</div>


