Objectsearch is a project mainly written in ..., it's free.
Java Search Engine that can be integrated with Hibernate, iBatis, JMS & Others
Object Search it's a Java framework that enables you to "google" your application objects.
This framework is designed for:
Soon: there will be a Maven dependency on public repos and a complete documentation with examples. Please be patient (or help ;)! )
The biggest differences are:
On the other side, When comparing to Compass or Hibernate Search, you'll find that we are not as mature as those projects, that means that some features aren't implemented yet.
Join the mailing-list at http://groups.google.com/group/objectsearch
All of the following are supported:
Mapping capabilities:
Searching capabilities:
Indexing capabilities:
You can download the latests build at: http://github.com/jklas/objectsearch
Or use it as a maven dependency (sorry for the 'snapshot'... it'll become a release soon):
<dependency>
<groupId>com.jklas</groupId>
<artifactId>search</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
To use it (minimalistic demo):
public class ObjectSearchSample {
@Indexable
public static class Foo {
@SearchId public long id ;
@SearchField public String bar;
public Foo(int id, String bar) {
this.id = id ; this.bar = bar;
}
//.. al you'd expect
}
public static void main(String[] args) throws Exception {
// map objects to search engine
SearchLibrary.configureAndMap(Foo.class);
// create indexer w/memory index
IndexerService indexerService = new DefaultIndexerService(new DefaultIndexingPipeline(), MemoryIndexWriterFactory.getInstance());
// create your stuff..
Foo foo = new Foo(1,"The quick brown fox jumps over the lazy dog");
// index it!
indexerService.create(foo);
// it's time to create a search query
VectorQuery query = new VectorQueryParser("lazy").getQuery();
// and a search over your memory index
VectorSearch search = new VectorSearch( query, MemoryIndexReaderFactory.getInstance() );
// do it!
List<VectorRankedResult> results = search.search(new DefaultVectorRanker());
// finally... let's see what comes out
System.out.println("Your query retrieved the object ID: "+results.get(0).getKey().getId());
}
}
For more usage examples check the tests.
That is great! Just fork the project in github. Create a topic branch, write some tests and the feature that you wish to contribute.
To run the tests:
mvn test
or you can use eclipse
Thanks for helping!
Object Search Framework
Copyright (C) 2010 Julian Klas
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA