Mailing List Archive

Question about using Lucene to search source code
Dear development community of Lucene:
Hi from student research assistant Yuxin Liu. I'm using Lucene to build an
index search for source code indexes using TF-IDF similarity. I have a set
of source code snippets and I want to use part of the source code snippet
as a query and obtain the document with its source code textfield that
matches the query with highest TF-IDF similarity.
Here is what I did: build indexing documents, store each source code
snippet as a textfield into one document with its id. Then use a query to
search for it. However, I don't know which kind of query should I use to
have the partial source code as my query; Because my query is not terms nor
phrases.
What is a good way to achieve this?
I am really looking for some suggestions because this has blocked me for a
while.

Thanks a lot in advance.
Sincerely,
Yuxin
Re: Question about using Lucene to search source code [ In reply to ]
Hi Yuxin

Can you provide a concrete example of a query and a document/code snippet?

Thanks

Michael


Am 20.12.21 um 03:06 schrieb Yuxin Liu:
> Dear development community of Lucene:
> Hi from student research assistant Yuxin Liu. I'm using Lucene to build an
> index search for source code indexes using TF-IDF similarity. I have a set
> of source code snippets and I want to use part of the source code snippet
> as a query and obtain the document with its source code textfield that
> matches the query with highest TF-IDF similarity.
> Here is what I did: build indexing documents, store each source code
> snippet as a textfield into one document with its id. Then use a query to
> search for it. However, I don't know which kind of query should I use to
> have the partial source code as my query; Because my query is not terms nor
> phrases.
> What is a good way to achieve this?
> I am really looking for some suggestions because this has blocked me for a
> while.
>
> Thanks a lot in advance.
> Sincerely,
> Yuxin
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org