mubashir
unread,Oct 1, 2010, 10:17:33 AM10/1/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lucandra-user
I added around one million documents in lucandra using following code:
Document doc = new Document();
doc.add(new Field("pringerId", pringerId, Store.YES,
Index.NOT_ANALYZED));
doc.add(new Field("menuId", menuId, Store.YES,
Index.NOT_ANALYZED));
doc.add(new Field("country", country, Store.NO,
Index.NOT_ANALYZED));
doc.add(new Field("cityName", cityName, Store.NO,
Index.NOT_ANALYZED));
doc.add(new Field("provinceName", provinceName, Store.NO,
Index.NOT_ANALYZED));
doc.add(new Field("latitude", latitude, Store.NO,
Index.NOT_ANALYZED));
doc.add(new Field("longitude", longitude, Store.NO,
Index.NOT_ANALYZED));
doc.add(new Field("googleMapUrl", googleMapUrl, Store.NO,
Index.NOT_ANALYZED));
doc.add(new Field("address", address, Store.NO,
Index.ANALYZED));
doc.add(new Field("likes", likes, Store.NO, Index.ANALYZED));
indexWriter.addDocument(doc, analyzer);
but when I run any search on the data I am getting TimeOutException:
java.lang.RuntimeException: TimedOutException()
at lucandra.LucandraTermEnum.loadTerms(LucandraTermEnum.java:
232)
at lucandra.LucandraTermEnum.skipTo(LucandraTermEnum.java:88)
at lucandra.IndexReader.docFreq(IndexReader.java:149)
at
org.apache.lucene.search.IndexSearcher.docFreq(IndexSearcher.java:138)
at
org.apache.lucene.search.Similarity.idfExplain(Similarity.java:735)
at org.apache.lucene.search.TermQuery
$TermWeight.<init>(TermQuery.java:46)
at
org.apache.lucene.search.TermQuery.createWeight(TermQuery.java:171)
at org.apache.lucene.search.Query.weight(Query.java:101)
at
org.apache.lucene.search.Searcher.createWeight(Searcher.java:147)
at org.apache.lucene.search.Searcher.search(Searcher.java:98)
at org.apache.lucene.search.Searcher.search(Searcher.java:108)
at
testlucandra.PringerPurchaseability.search(PringerPurchaseability.java:
126)
at
testlucandra.PringerPurchaseability.main(PringerPurchaseability.java:
151)
I also tried to perform search on a smaller set of data (around 10,000
documents) but this time I get ArrayIndexOutOfBoundException:
java.lang.ArrayIndexOutOfBoundsException: 1024
at lucandra.IndexReader.addDocument(IndexReader.java:448)
at
lucandra.LucandraTermEnum.getTermDocFreq(LucandraTermEnum.java:352)
at lucandra.LucandraTermDocs.seek(LucandraTermDocs.java:128)
at
org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:814)
at org.apache.lucene.search.TermQuery
$TermWeight.scorer(TermQuery.java:74)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:210)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:170)
at org.apache.lucene.search.Searcher.search(Searcher.java:98)
at org.apache.lucene.search.Searcher.search(Searcher.java:108)
at
testlucandra.PringerPurchaseability.search(PringerPurchaseability.java:
126)
at
testlucandra.PringerPurchaseability.main(PringerPurchaseability.java:
151)
Can someone guide me whether I am doing something wrong or lucandra
wouldn't scale up for large records?