https://github.com/lmammino/lucenenewsgroups
A simple university exercise with Apache Lucene 3.1 - This application performs indexing and search on a series of files that represent the post of some newsgroups
https://github.com/lmammino/lucenenewsgroups
java lucene search search-engine
Last synced: over 1 year ago
JSON representation
A simple university exercise with Apache Lucene 3.1 - This application performs indexing and search on a series of files that represent the post of some newsgroups
- Host: GitHub
- URL: https://github.com/lmammino/lucenenewsgroups
- Owner: lmammino
- Created: 2011-04-29T14:31:28.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-05-05T21:18:10.000Z (about 15 years ago)
- Last Synced: 2025-03-15T00:12:19.874Z (over 1 year ago)
- Topics: java, lucene, search, search-engine
- Language: Java
- Homepage: http://loige.co
- Size: 8.05 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
LuceneNewsgroups
================
Hi fellows,
LuceneNewsgroup is a simple command line software that I wrote for an university exercise.
Its sole purpose is to index a bunch of mailing list posts (stored locally) and to perform query based searches on them.
It is developed in java with [Netbeans](http://netbeans.org/) and uses the [Lucene library](http://lucene.apache.org/) (v 3.1) as indexing and searching engine.
Dependencies
------------
You should have java 1.5 or higher installed on your system.
Installation
------------
LuceneNewsgroup does not require you to perform any kind of setup. It's distributed as jar file (you can find it in the **dist** folder). You can copy the jar file wherever you want and just run it from the console by using the command `java -jar path/to/LuceneNewsgroups.jar`. Obviously you should replace the `path/to/` with the real path where you put the jar file.
As it is a command line software, you have to type every single command. Yeah, this sounds really boooring! You can ease things a bit by creating an alias to shorten the ugly `java -jar path/to/LuceneNewsgroups.jar` command. On unix-based systems you can do this with the command `alias lns='java -jar path/to/LuceneNewsgroups.jar'`. This way you created an alias called **lns** and now you can just type `lns` instead of `java -jar path/to/LuceneNewsgroups.jar`.
( Thanks to my great friend [saro](https://github.com/saro) for the hint ).
The workflow
------------
To use LuceneNewsgroups you should have a set of files that represents newsgroup posts. You can find some of them in the **data.zip** file. These files should be placed on a directory and can be even organized in subdirectories if needed. Each subdirectory is intended as a category.
The default workflow follow these steps:
1. Create the index for a set of posts placed inside a directory
2. Perform searches on the indexed directory of posts
3. Open some of the matched files
So generally you would write commands like these:
cd path/to/my/posts/directory
lns createIndex
lns search god OR hell
lns open 21580
(**N.B.** I'm supposing you've created an alias called **lns** as described above)

Commands
--------
Here's the complete list of available commands
version
Shows informations about the version of the software
createIndex [<folder>]
Creates an index for all the files contained in the folder directory. If you don't specify a folder, it will use the current working directory.
search <query>
Search within the index of the current dir for documents that match the given query.
open <id>
display the content of the document indexed with the given id.
That's all
----------
As the title says that's all for the moment! If you have any question feel free to ask: lmammino [at] oryzone [dot] com.
In the meanwhile please cross your fingers hoping I'll pass the exam :)