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

Advanced search syntax #12

Open
tdfischer opened this issue Oct 31, 2012 · 3 comments
Open

Advanced search syntax #12

tdfischer opened this issue Oct 31, 2012 · 3 comments

Comments

@tdfischer
Copy link
Member

It'd be most excellent to be able to query Spiff for certain things in a semi-structured way. Searching for, eg:

hasMeta:part-bin-unit

Would return all Resources that have the 'part-bin-unit' metadata.

A more advanced query:

meta:part-bin-row = 8 AND (meta:part-type = resistor OR meta:part-type = transistor)

This would find all resistors and transistors in all row 8s of all the parts bins .

A feature like this could be used to keep track of parts bins and their locations in Spiff. Looking for a resistor between 100 and 200 Ohms?

meta:part-type = resistor AND (meta:resistor-value <= 200 AND meta:resistor-value >= 100)

Build a quick Qt or even plain PHP app that sits fullscreen on a kiosk next to the parts bins and you have an instant part locator system. Add a button to it that toggles the 'in-stock' metadata value between true/false, and you can quickly see what you are out of stock of:

meta:in-stock = true

See what resources are going to be tied up next week:

resource:reserved AND (event:start > next monday AND event:end < next friday)

See what resources are reserved for a specific event:

resource:reserved AND event:id = 82

Find the top three people trained on any of the three circular saws:

(resource:id = 4 OR resource:id=8 OR resource:id = 83) AND member:training < 3

Proposed keywords:

  • resource:meta: - Evaluates to the value of a resource's metadata
  • resource:hasMeta: - Evaluates to true if a resource has a specific metadata, regardless of value
  • resource:reserved: - Evaluates if a resource is attached to an event or not
  • resource:id
  • event:start - Evaluates to an event's start date.
  • event:end - Evaluates to an event's end date
  • event:id - Evaluates to an event's ID.
  • member:training - Evaluates to a member's relative training rank on resources, with zero being the highest rank of all users trained for a resource.
@relrod
Copy link

relrod commented Nov 1, 2012

Rather than implementing a custom lexer/logic parser/etc, would it be reasonable to look into using something like Lucene here?

@tdfischer
Copy link
Member Author

Sounds like an awful lot of overkill. I want as few dependencies with Spiff as possible so other less tech savy spaces can get things up and running without any effort.

@relrod
Copy link

relrod commented Nov 1, 2012

That's fine, but I suspect it's going to take quite a lot of work to implement something like this from scratch.

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

No branches or pull requests

2 participants