SYNHAK / spiff

Spaceman Spiff Manages Spaces
GNU Affero General Public License v3.0
13 stars 5 forks source link

Advanced search syntax #12

Open tdfischer opened 11 years ago

tdfischer commented 11 years ago

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:

relrod commented 11 years ago

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

tdfischer commented 11 years ago

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 commented 11 years ago

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