Questions tagged [query-parser]

69 questions
19
votes
2 answers

Lucene: exception - Query parser encountered after "some word"

I am working on a classification problem to classify product reviews as positive, negative or neutral as per the training data using Lucene API. I am using an ArrayList of Review objects - "reviewList" that stores the attributes for each review…
Reema
  • 1,147
  • 1
  • 9
  • 11
14
votes
3 answers

Lucene queryparser with "/" in query criteria

When I try to search for something such as "workaround/fix" within Lucene, it throws this error: org.apache.lucene.queryparser.classic.ParseException: Cannot parse 'workaround/fix': Lexical error at line 1, column 15. Encountered: after :…
abitnew
  • 245
  • 2
  • 4
  • 10
9
votes
3 answers

What does parsing a query mean?

Most relational databases handles a JDBC / SQL query in four steps: Parse the incoming SQL query Compile the SQL query Plan/optimize the data acquisition path Execute the optimized query / acquire and return data I want to know what does…
user3239652
  • 775
  • 2
  • 9
  • 23
8
votes
1 answer

Why does Lucene QueryParser needs an Analyzer

I'm new to Lucene and trying to parse a raw string into a Query using the QueryParser. I was wondering, why is the QueryParser.Parse() method needs an Analyzer parameter at all? If analyzing is something that has to do with querying, then an…
haim770
  • 48,394
  • 7
  • 105
  • 133
7
votes
1 answer

Solr/Lucene query lemmatization with context

I have successfully implemented a Czech lemmatizer for Lucene. I'm testing it with Solr and it woks nice at the index time. But it doesn't work so well when used for queries, because the query parser doesn't provide any context (words before or…
dedek
  • 7,981
  • 3
  • 38
  • 68
6
votes
1 answer

Lucene QueryParser in multiple threads: synchronize or construct new each time?

I have a web application where users submit queries to a Lucene index. The queries are parsed by a Lucene QueryParser. I learned the hard way that QueryParser is not thread-safe. Is it better to use a single QueryParser instance, and synchronize…
Robert Tupelo-Schneck
  • 10,047
  • 4
  • 47
  • 58
3
votes
0 answers

Analyzing queries in the client side of Elasticsearch but not on the server

We are migrating our Lucene based search codebase to Elasticsearch. The major problem we encountered is how we should migrate our QueryParsers. In our old solution, the QueryParsers take in a human input query string, and transform that to Lucene's…
ohw
  • 1,619
  • 12
  • 20
3
votes
1 answer

Lucene text search failing for names ending with a non-alphabet

In my Webmethods application I need to implement a Search functionality and I had done it with Lucene. But the search is not retrieving results when I am searching for file with title ending in something other than alpabet.for eg:- doc1.txt or…
Cheese
  • 245
  • 2
  • 3
  • 9
3
votes
1 answer

Lucene max term query limit

Does Lucene (or Solr) still have the 1024 max terms query limit? I could not find this info in the 3.6 lucene version and I'd need to fire a query with a high number of terms. Thank you, - Dan
Daniele
  • 359
  • 7
  • 15
2
votes
1 answer

Is there a way to list tables and columns used in a ORACLE query?

I've a huge Oracle query (~20k lines) and I need to list out all the tables and columns used in that query. I've google'd and found few SQL-Parser tools and plugins, but they didn't worked out to me. Found below perl library, but it is not…
tuxian
  • 159
  • 5
  • 12
2
votes
2 answers

Can Lucene.Net (3.0.3 or 4.8.0) QueryParser search for numbers?

I started with the Lucene.Net 4.8 demo project (https://github.com/synhershko/LuceneNetDemo). My goal is to be able to use a query parser (QueryParser or MultiFieldQueryParser) to search for text as well as numbers. Is that possible? All I have…
Greg Mulvihill
  • 1,665
  • 1
  • 15
  • 12
2
votes
2 answers

Lucene error while parsing Query: Cannot parse '': Encountered "" at line 1, column 0

I want to parse some text using Lucene query parser to carry out basic text preprocessing on the texts. I used following lines of code: Analyzer analyzer = new EnglishAnalyzer(); QueryParser parser = new QueryParser("", analyzer); String text =…
Krishnendu Ghosh
  • 314
  • 4
  • 21
2
votes
1 answer

QueryParser with CustomAnalyzer messes order of use of PatternReplaceCharFilter

I am using org.apache.lucene.queryparser.classic.QueryParser in lucene 6.0.0 to parse queries using a CustomAnalyzer as shown below: public static void testFilmAnalyzer() throws IOException, ParseException { CustomAnalyzer nameAnalyzer =…
Bahaa
  • 1,577
  • 18
  • 31
2
votes
1 answer

How to search term in a certain range in Lucene

I want to search terms which is in [0, 10], and terms are from the field "CityId" that is stored as Integer. What I have written is below: String queryStr = "CityId : [0, 10]"; Query query = parser.parse(queryStr); TopDocs topDocs =…
Fairy_LFen
  • 61
  • 1
  • 3
2
votes
2 answers

Comparison operators with strings using Lucene

Integrated the QueryParser of Lucene in to my application's search. I have a stringField for which i have to perform some comparison operators also. eg: age>3 age<4 But i cannot make the field Int.Because sometimes it may have the string values like…
Nidhin Joseph
  • 1,461
  • 3
  • 15
  • 32
1
2 3 4 5