# Fscrawler to find line number of an indexed file

**URL:** <https://discuss.elastic.co/t/fscrawler-to-find-line-number-of-an-indexed-file/135915>\
**Category:** Elasticsearch\
**Created:** [June 14, 2018, 12:29pm UTC](https://discuss.elastic.co/t/fscrawler-to-find-line-number-of-an-indexed-file/135915 "2018-06-14T12:29:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stackoverflow\_s](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@stackoverflow\_s](https://discuss.elastic.co/u/stackoverflow_s)\
**Post date:** [June 14, 2018, 12:29pm UTC](https://discuss.elastic.co/t/fscrawler-to-find-line-number-of-an-indexed-file/135915/1 "2018-06-14T12:29:23Z")

</div>

_Use Case_ : I want to search for a duplicate method name across all local java files and retrieve the filename, linenumber and foldername to which it belongs.

In one of my local drive I have a several folders, where each of these folders contain .java files. Note these folders can keep changing dynamically.  
I have made use of fscrawler to index all my .java files to elastic search.

1. I am looking at an option where index is the folder name with type as filename, How can this be achieved dynamically without changing the json setting every time ?
2. If there are duplicate filenames present in the same folder, does fscrawler take care of duplicate and still index then with the option of filename\_as\_id set to true ?
3. How to retrieve the line number from indexed content ?

Any insights will be helpful here.

---

<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 12, 2018, 12:38pm UTC](https://discuss.elastic.co/t/fscrawler-to-find-line-number-of-an-indexed-file/135915/2 "2018-07-12T12:38:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
