Hacker News new | ask | show | jobs
Show HN: CodeExchange – A new Java code search engine (codeexchange.ics.uci.edu)
19 points by leemartie 4340 days ago
7 comments

Hi DanielStraight!

Great question. CodeExchange is intended to help you reformulate your query. That is, as you get results, it aims to help you change your query so the next results are closer to what you want.

Some typical use cases are finding API usage examples and algorithm implementations. This could mean finding code that invokes API methods, extends a parent class, implements an interface, implements depth first search or merge sort, etc...

Some examples:

[Looking for regular expression code] An example may be issuing a keyword search “regular expression”, then taking the recommendation “[imports library] java.util.regex.pattern” to find code that uses this library, and then clicking on the method call “Pattern.matches” in a code result in order to return code that calls this method.

[looking for Minecraft code] Another example may be issuing the keyword search “minecraft map” and then taking the recommendation “[keywords] world” to help disambiguate the word “map” from other meanings in Java.

[looking for merge sort code] Yet another example could be issuing the keyword search “merge sort” and then getting empty class results. Since algorithms have logic in them (loops, if statements, etc...) you can critique the result by clicking the up arrow above “complexity” in order to get results with more logic in them.

These examples don't have to start out with keywords, however. Sometimes you are working with a team that already has libraries being used and you have to learn how to use them. To specify them up front you can use the “Advanced Search”

The search history is intended to support reissuing queries that worked in the past, to find code you need today.

Thanks for your interest! Let me know if I can answer any other questions or clarify anything. If you have time please fill out the survey on our site to help our research!

Can you give some examples of searches which provide really good results? Or some idea of what use cases you would use the search for?
Some example search videos have been posted here: http://codeexchange.ics.uci.edu/examples.html Thanks!
Tiny feed back after first look, the "Advanced search" needs more space :) https://www.dropbox.com/s/w9w9nvdb9tkf1jn/Screenshot%202014-...

Other than that, looking good.

Thanks :). We shall fix this soon!
Interesting. It looks like its actually parsing the Java to produce the results as a search for "bing" shows the number of imports and complexity of the code. This would be similar to sourcegraph.

I wonder what parser is used and if it can be applied to other languages.

Good observation! We are continuously expanding our efforts, and will be looking into supporting other languages soon. For us, this will mean using or writing different parsers for different types of languages. Suggestions for which languages you want are appreciated! More details on the engineering of CodeExchange are being written.
Interesting. This is a university project yes? Will you be looking to open source some of the code, in particular the language parsers.

I ask from a purely selfish purpose as I want to integrate this sort of information into searchcode.com and would prefer to avoid writing my own implementations.

Yes, it is a university project. We hope to make it open source, but first we are working to stabilize it and write about it.
Ah very cool. I have added a watch to your profile so I can see any further developments.
Is the site overloaded right now? I typed in a few queries, nothing shows up, and the "status" under the 1st column is always "SEARCHING..."
Thanks for letting us know! We are checking into it.
Still down for me. Still Searching
zot zot

what was the point of this search engine? I mean who came up with this idea that we needed to build a java code search engine?

I dig the results view, its pretty cool to see 3 codes side by side.

We are continuously expanding our efforts, and will be looking into supporting other languages soon. Suggestions for which ones you want first are appreciated! Thanks (zot zot)!
Just wanted to point out grepcode.com for comparison.
Thanks for the pointer! As an academic research project, we try to collect as many of these as possible.