ginjo / rfm

FileMaker to Ruby adapter.
MIT License
45 stars 22 forks source link

Search Result Set #20

Open sancheas opened 10 years ago

sancheas commented 10 years ago

I'm pulling down my results specified by the client, without using elastic search, is there an easy way to search results, outside of the .find method?

For example I find all my data and store it in @fmResults

@fmResults[0] = {:field1 => "Duck", :field2 => "123", :field3 => "Kyle"} 
@fmResults[1] = {:field1 => "Cat", :field2 => "234", :field3 => "Jim"} 
@fmResults[2] = {:field1 => "Dog", :field2 => "567", :field3 => "Alex"} 
@fmResults[3] = {:field1 => "Ardvark", :field2 => "890", :field3 => "Jim Bob"}

I know I can build a form with all the fields and pass them to the RFM .find method, but that is going to involve multiple search fields for each field and I'd prefer to have a single field.

Thanks for any suggestions

ginjo commented 10 years ago

Several ways to create complex rfm searches with simple front-ends (a single-field search form).

  1. An Rfm resultset is just an array, so you can use any ruby method that iterates over the array to filter specific records.
  2. Use a single field on your search form, then programmatically build a compound rfm find request where the search criteria is inserted into multiple find-requests, with each request focusing on a specific field of your layout.
  3. Create a calc field in Filemaker that concatenates the fields you want to search on, index that calc field, then perform your rfm query against that calc field.

Each of these have benefits & costs, and there are probably yet more ways to do this. These are just the ones that come to mind.