question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Query syntax: Add support for spaces in field names

See original GitHub issue

At the moment fields can be registered statically or dynamically with spaces in them:

var index = new FullTextIndexBuilder<int>()
    .WithObjectTokenization<Customer>(o => o
      .WithId(c => c.CustomerId)
      .WithField("Customer Name", c=>c.Name)

But there’s no way using the LIFTI query syntax to filter on a field name with a space in it:

Customer Name=Something

The first part of the field name becomes part of the query.

We need to introduce something to quote a field name, e.g.

[Customer Name]=Something

We’d need to allow for edge cases where the field name contains a close bracket and it needs to be escaped.

Issue Analytics

  • State:open
  • Created 3 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mikegoatlycommented, Aug 14, 2023

I’m going to split wildcards out to #77 - they add significant complexity and implementing this feature without them add its own value.

1reaction
h0lgcommented, Jul 11, 2023

It would also be be nice to match multiple fields against the same expression. Let’s assume I want to match the same query against the UTF8 and the ASCII representation of a customer name:

var index = new FullTextIndexBuilder<int>()
    .WithObjectTokenization<Customer>(o => o
      .WithId(c => c.CustomerId)
      .WithField("Customer Name", c => c.Name)
      .WithField("Customer ASCII Name", c => c.AsciiName)

If possible, I’d like a query without repetition, e.g. [Customer Name|Customer ASCII Name]=Something

Or let’s assume I want to search a group of dynamic fields sharing the same same prefix or suffix - then I’d like to query those with [prefix*]=query or [*suffix]=query.

Obviously, this can be worked around by OR-combining the same query for different field names - so it may really just a be a convenience feature for people manually writing LIFTI queries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to write SQL queries with spaces in column names
DML SQL query with space in a column name. When we run INSERT, UPDATE, and DELETE statements, we must use a square bracket...
Read more >
sql - How to select a column name with a space in MySQL
I am working on a project where another developer created a table with column names like 'Business Name' . That is a space...
Read more >
How to select a column name with spaces in MySQL
To select a column name with spaces, use the back tick symbol with column name. The symbol is ( ` `). Back tick...
Read more >
How to write SQL Statements With Spaces In Column Names
You can use `. $query = \Drupal::database()->select('Product_Details', 'n'); $query->addField('n', 'S.No.'); $query->condition('n. · Thanks for ...
Read more >
How do you select a column with spaces in SQL?
To select a column name with spaces, use the back tick symbol with column name. The symbol is ( ` `). Back tick...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found