lucene

search a analyzed field through the stored original value in elasticsearch

混江龙づ霸主 提交于 2020-01-16 20:01:54
问题 In elastic search I have a field that is analyzed and I am also storing the original value. I want to search the field with the stored value not the analyzed value. Is there any way to do it? note: I cannot make the field not_analyzed , because I am searching the analyzed values also. 回答1: Take a look at the multi fields type, which will allow to two store the field both analyzed for full text search and not_analyzed for exact matches. 来源: https://stackoverflow.com/questions/24156132/search-a

Error while making CLucene for Max OS X 10.10

允我心安 提交于 2020-01-16 13:19:14
问题 I am trying to build CLucene in Max OS X 10.10. I followed the instructions here. The cmake .. command ran correctly, but after that, when I try to run make with the makefile generated, I get the following error: I Googled it and found reports of similar errors in some forums, and even found a similar question in Stackoverflow as well: Error when Make CLucene, but nowhere did I find a canonical solution. What should I do to fix this? 回答1: There is a bug for the Mac OS X version. You need to

How to retrieve all documents(size greater than 10000) in an elasticsearch index

好久不见. 提交于 2020-01-16 09:03:44
问题 I am trying to get all documents in an index, I tried the following- 1) getting the total number of records first and then setting /_search?size= parameter -doesn't work as size parameter is restricted to 10000 2)tried paginating by making multiple calls and used the parameters '?size=1000&from=9000' -worked till 'from' was < 9000 but after it exceeds 9000 i again get this size restriction error- "Result window is too large, from + size must be less than or equal to: [10000] but was [100000].

Solr TermsComponent: Usage of wildcards

我们两清 提交于 2020-01-16 04:44:07
问题 I'm using Solr 1.4.1 and I'm willing to use TermsComponent for AutoComplete. The problem is, I can't get it to match strings with spaces in them. So to say, terms.fl=name&terms.lower=david&terms.prefix=david&terms.lower.incl=false&indent=true&wt=json matches all strings starting with "david" but if I change it to: terms.fl=name&terms.lower=david%20&terms.prefix=david%20&terms.lower.incl=false&indent=true&wt=json it doesn't match all strings starting with "david ". Is it meant to be that way?

Lucene updateDocument not deleting documents

≡放荡痞女 提交于 2020-01-16 04:39:05
问题 this seems a common problem, except I have had no trouble with this before and the usual fix does not work. It is probably something silly, but I can not find it. I want to index a yammer site as the yammer api is not fast enough for my purpose, problem is that when I try to update my index using the updateDocument functionality the old ones are not deleted. But I have a stored unique key that is not analysed. Here is the relevant code: Document newdoc = new Document(); newdoc.add(new Field

How to test services that use Hibernate Search?

我只是一个虾纸丫 提交于 2020-01-16 03:28:48
问题 I have JUnit4 test class, annotated with @Transactional with this method in it, along with other methods: @Test public void testDiscoverArtworksByTitle() { FullTextEntityManager ftem = Search.getFullTextEntityManager(this.entityManager); this.prepareArtworksForListing(); ftem.flushToIndexes(); List<ArtworkListItem> listItems = this.artworkService.discoverArtworksByTitle("Die Hard"); Assert.assertNotEquals("There are some items in the list", 0, listItems.size()); // housekeeping ftem.purgeAll

RegEx matching using Lucene

拥有回忆 提交于 2020-01-15 23:46:41
问题 I would like to find "Bug reports" with Lucene using a regular expression, but whenever I try it doesn't work. I used the code from the Lucene page to avoid a bad setup. Here is my code: import java.util.regex.Pattern; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org

RegEx matching using Lucene

回眸只為那壹抹淺笑 提交于 2020-01-15 23:45:47
问题 I would like to find "Bug reports" with Lucene using a regular expression, but whenever I try it doesn't work. I used the code from the Lucene page to avoid a bad setup. Here is my code: import java.util.regex.Pattern; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org

Complex Phrases and/or ComplexPhraseQueryParser in Lucene.NET

倖福魔咒の 提交于 2020-01-15 23:38:47
问题 I am trying to search for fairly complex queries with Lucene.Net like "inject* needle*" OR "point* thingy"~2 So basically I need wildcards in regular as well as proximity phrases. However, the basic Lucene.Net QueryParser gets rid of these wildcards. I understand that ComplexPhraseQueryParser would work for that, unfortunately this is not included in Lucene.Net. Is there any way of constructing queries like this in Lucene.Net? 回答1: I ended up by actually porting the ComplexPhraseQueryParser

Unable to delete the existing document in lucene index

筅森魡賤 提交于 2020-01-15 12:47:32
问题 I am using Lucene.Net (version 2.9.4.1) to implement a simple search module. I'm trying to delete the document if it exists in the index using the following code, var analyzer = new StandardAnalyzer(Version.LUCENE_29); var indexWriter = new IndexWriter( LuceneSearch._luceneDir, analyzer, IndexWriter.MaxFieldLength.UNLIMITED); var searchQuery = new TermQuery(new Term("ListID", listingDoc.Get("ListID"))); indexWriter.DeleteDocuments(searchQuery); where listingDoc is of type Document i'm trying