Support for Linker with Query type
See original GitHub issueDescribe the solution you’d like
I’d like to use Lucence query builder to generate my queries instead of the query String. The toString
method does not guarantee compatibility and it fails for some cases.
For example :
val addressTerms = Seq("harvard","denver")
val booleanQueryBuilder = new BooleanQuery.Builder()
addressTerms.foreach(t=>{
booleanQueryBuilder.add(new FuzzyQuery(new Term("address", t)), BooleanClause.Occur.SHOULD)
})
val booleanQuery: BooleanQuery = booleanQueryBuilder.setMinimumNumberShouldMatch(addressTerms.size/2).build()
val query = booleanQuery.toString()
Produces the following exception :
(address:harvard~2 address:denver~2 )~3': Encountered " <FUZZY_SLOP> "~3 "" at line 1, column 95.
Doing a search and replace for the token “~” is not really an option because the query won’t behave as expected
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (21 by maintainers)
Top Results From Across the Web
Apollo Federation subgraph specification
Query. The graph router uses this root-level Query field to directly fetch fields of entities defined by a subgraph. This field must take...
Read more >Query work items by link or attachment count in Azure Boards
Learn how to query work items based on link type, link count, link restrictions, and attachment file count in Azure Boards.
Read more >Passing Information via Query Strings
A query string allows you to pass information to and from a website by simply adding, or “appending,” that information to the end...
Read more >Conversion linker - Tag Manager Help
Conversion linker tags are used to help tags measure click data so that conversions are measured effectively. Deploy a conversion linker tag on...
Read more >Using media queries - CSS: Cascading Style Sheets | MDN
A media query is composed of an optional media type and any ... a query to test against whether the device supports hovering...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think you have a valid point here and put some effort on this.
I have a prototype (see below), where you can specify a linker as a function
Row => Query
. Will this work for you? I tested it a bit and do not get a serialization error!https://github.com/zouzias/spark-lucenerdd/pull/154/files#diff-4a4a384e7770d218cc77733cd7d485a9R547
Thank you a lot for the feedback / suggestion, I think such an improvement will improve a lot the API of
LuceneRDD
.If you agree on the feature, I can quickly make a snapshot release to test.
I added a little bit more of support in this commit https://github.com/yeikel/spark-lucenerdd/commit/3e408c7fbd884aaeaae14a9add0c4151dd904017.
Could you please review it?