Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the lowercasing of CQL index names optional? #29

Open
danmichaelo opened this issue Nov 6, 2020 · 0 comments
Open

Make the lowercasing of CQL index names optional? #29

danmichaelo opened this issue Nov 6, 2020 · 0 comments

Comments

@danmichaelo
Copy link

Hi. I tried to define a few indices with camelcase, such as bib.titleSeries:

# catmandu.yml
store:
  es_store:
    package: ElasticSearch
    options:
      client: 6_0::Direct
      bags:
        mlnb:
          type: _doc
          cql_mapping:
            indexes:
              bib.titleSeries:
                title: Series title (440, 490, 830, 840, 400$t, 410$t, 411$t)
                field:
                  - search.series
                op:
                  'any': true
                  'all': true
                  '=': true
                  'exact': true

But this resulted in a CQL Query syntax error from here:

or Catmandu::Error->throw("cql error: unknown index $qualifier");

The problem is that the index name doesn't match because it's lowercased to bib.titleseries at line 112. Which I guess is done to make the index name case-insensitive when searching? This requires you to only use lowercase index names in the configuration file though. Which is not always suitable, since the cql_mapping is also used to generate the explain response by Dancer-Plugin-Catmandu-SRU. And the index names in the explain response may need to be correctly cased according to some standard, like the bib context set.

As a workaround I commented out line 112.

I guess one solution could be to introduce a configuration parameter that makes the lowercasing optional.

Another could be to map lowercased versions of the keys in $indexes to the actual keys, so that the lookup is case insensitive even if the index names are not defined using all lowercase in the configuration file. I'm a novice when it comes to Perl, but I could try to make a PR for this as a learning exercise :)

Let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant