You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucy.apache.org by gramcha <ha...@gmail.com> on 2013/06/25 07:30:30 UTC

[lucy-user] Can Lucene return search results with line number?

I want to implement "Find in Files" similar to one in IDE's using lucene.
Basically wants to search in source code files like .c,.cpp,.h,.cs and .xml.
I tried the demo shown in apache website. It returns the list of files
without line numbers and number of occurance in that file. I am sure there
should be some ways to get it.

Is there anyway to get those details?



--
View this message in context: http://lucene.472066.n3.nabble.com/Can-Lucene-return-search-results-with-line-number-tp4072929.html
Sent from the lucy-user mailing list archive at Nabble.com.

Re: [lucy-user] Can Lucene return search results with line number?

Posted by Hernan Lopes <he...@gmail.com>.
for that you have many steps.. i bet lucy wont tell you the specific line
number. But it could tell you which documents contain that piece of code.
So you will need:
- Retrieve a list of files containing the text you are searching.
- Create a perl script that will iterate over each file on that returned
list. This script must tell you the line number where the text is found.
- Show the results to user


On Tue, Jun 25, 2013 at 2:30 AM, gramcha <ha...@gmail.com> wrote:

> I want to implement "Find in Files" similar to one in IDE's using lucene.
> Basically wants to search in source code files like .c,.cpp,.h,.cs and
> .xml.
> I tried the demo shown in apache website. It returns the list of files
> without line numbers and number of occurance in that file. I am sure there
> should be some ways to get it.
>
> Is there anyway to get those details?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Can-Lucene-return-search-results-with-line-number-tp4072929.html
> Sent from the lucy-user mailing list archive at Nabble.com.
>