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

Issues with "Tokenizers" syntax #90

Open
senpro-ingwersenk opened this issue Sep 16, 2024 · 1 comment
Open

Issues with "Tokenizers" syntax #90

senpro-ingwersenk opened this issue Sep 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@senpro-ingwersenk
Copy link

Describe the bug

I was getting started with the migrations for my app and ran into this issue:

> surrealdb-migrations.exe apply
Error:
   0: Parse error: Failed to parse query at line 92 column 16
   0:    |
   0: 92 | TOKENIZERS ascii
   0:    |            ^
   0:
   1: Parse error: Failed to parse query at line 92 column 16
   1:    |
   1: 92 | TOKENIZERS ascii
   1:    |            ^
   1:

Location:
   C:\Users\ingwersenk\.cargo\registry\src\index.crates.io-6f17d22bba15001f\surrealdb-migrations-1.5.0\src\surrealdb.rs:157

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

I eventually tracked it down to this snippet:

DEFINE ANALYZER description_autocomplete
    TOKENIZERS ascii
    FILTERS lowercase,edgengram(3,10);

However, this should be accurate with the docs: https://surrealdb.com/docs/surrealql/statements/define/analyzer

To Reproduce
Here is a simplified version of the schema:

DEFINE TABLE process
    SCHEMAFULL;
DEFINE FIELD description ON process TYPE string;

DEFINE ANALYZER description_autocomplete
    TOKENIZERS ascii
    FILTERS lowercase,edgengram(3,10);

DEFINE INDEX title_search_idx
    ON TABLE process
    COLUMNS title
    SEARCH ANALYZER description_autocomplete
    BM25
    HIGHLIGHTS;

Expected behavior
Aside from not seing which file caused the error, I had expected to pass, as it is documented.

Information

  • SurrealDB version: image: surrealdb/surrealdb:latest (logs say Running 1.5.5 for linux on x86_64)
  • surrealdb-migrations version: 1.5.0

Additional context
SurrealDB is running in a container and I use a .surrealdb file to point the tool towards the location of my schemas and alike. It totally sees them, but it then just ... kinda implodes? I am a little lost.

The output suggests to enable RUST_BACKTRACE - well, here goes:

> surrealdb-migrations.exe apply
Error:
   0: Parse error: Failed to parse query at line 92 column 16
   0:    |
   0: 92 | TOKENIZERS ascii
   0:    |            ^
   0:
   1: Parse error: Failed to parse query at line 92 column 16
   1:    |
   1: 92 | TOKENIZERS ascii
   1:    |            ^
   1:

Location:
   C:\Users\ingwersenk\.cargo\registry\src\index.crates.io-6f17d22bba15001f\surrealdb-migrations-1.5.0\src\surrealdb.rs:157

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: BaseThreadInitThunk<unknown>
      at <unknown source file>:<unknown line>
   2: RtlUserThreadStart<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

Setting the COLORBT_SHOW_HIDDEN env variable made no difference.

Kind regards!

@Odonno Odonno added the bug Something isn't working label Feb 2, 2025
@Odonno
Copy link
Owner

Odonno commented Feb 2, 2025

I am not sure why this issue can happen. Are you still having this issue with the latest releases of SurrealDB and surrealdb-migrations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants