Index index = ElasticLunr.createIndex(); index.addField("title"); index.addField("body");Adding documents to the index is as simple as:
JSONObject doc1 = new JSONObject(); doc1.put("id", 1); doc1.put("title", "Oracle released its latest database Oracle 12g"); doc1.put("body", "Yestaday Oracle has released its new database Oracle 12g."); ... index.addDoc(doc1);Searching is simple:
List<JSONObject> results = index.search("Oracle database"); JSONObject result = results.get(0); String ref = result.getString("ref");
To join this project, please contact the project administrators of this project, as shown on the project summary page.
Source code for this project is available as downloads or through the git repository used by the project, as accessible from the project develop page.
Copyright 2017 Wei Song. Copyright 2018 Herve Girod. All Rights Reserved. Documentation and source under the MIT licence