h2database / h2database/h2database

Lucene full text search with colon

Open
#1,482 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.6k
Forks
1.3k
Avg merge
1d 2h
Merged PRs (30d)
9

Description

Lucene supports escaping special characters that are part of the query syntax. see https://lucene.apache.org/core/3_6_2/queryparsersyntax.html

The current list special characters are
+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
To escape these character use the \ before the character. For example to search for (1+1):2 use the query:
\(1\+1\)\:2

But when trying to include a colon in the search query the returned value does not contain any results.
e.g. "SELECT * FROM FTL_SEARCH('URL:C\\:*',0,0);"

Without the \: the results are returned as expected. What am I doing wrong?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the exact FTL_SEARCH query from the issue and trace the full-text search handling for an escaped colon; done means establishing whether the query should return the same matches as the unescaped form and capturing that behavior in a regression test or clarified report.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.