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

need to support WHERE / Index.Cond() #3

Open
steveyen opened this issue Jan 29, 2019 · 2 comments
Open

need to support WHERE / Index.Cond() #3

steveyen opened this issue Jan 29, 2019 · 2 comments

Comments

@steveyen
Copy link
Member

steveyen commented Jan 29, 2019

An FTS Index that has type mappings is basically translatable, where each type mapping translates to another Index with a different WHERE or Index.Cond().

n1fty/index.go

Line 93 in 7b74840

// WHERE clause stuff, not supported

The idea, let's say I have an FTS index "myFTSIdx" on the beer-sample bucket that looks like...

  type: beer
      mapping of the beer fields
  type: brewery
      mapping of the brewery fields
  default:
      mapping of the fields that aren't "type" of beer nor brewery

So, that would get expressed as 3 different Indexes...

Index myFTSIdx-beer
   Cond() => "type = 'beer'"

Index myFTSIdx-brewery
   Cond() => "type = 'brewery'"

Index myFTSIdx-default
   Cond() => "type != 'beer' AND type != 'brewery'"

Also, better double-check with Sitaram that this is the correct expression.

@steveyen
Copy link
Member Author

Another related thought is that this probably means convertIndexDefs() needs to change where it converts each type-mapping into a separate index.

Looks like convertIndexDefs() is going to need some scrubbing and/or discussion.

@steveyen
Copy link
Member Author

Oh, looks like this might be more of a concern for the future "use case 5".

To handle this for today / Mad Hatter, I think perhaps we just need to ensure some naming convention that allows for a "use case 5" future.

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