0

The AutoDesk Forge Viewer has a search function that takes in a search text, callbacks and an array of attributes to look at:

enter image description here

but what I want to do is search for a certain value in the "Level" attribute and a certain value in the "Category"-attribute of element at the same time. Is this possible with the existing search-function or am I missing something in the API?

stonecompass
  • 547
  • 9
  • 27

1 Answers1

1

Cannot be done, the search feature in the viewer API is pretty basic, will let you search a text only in the property values and you cannot use combined queries ... The best suggestion for what you are looking for would be to read all the properties, which can be done using Model Derivatives API (see /GET :urn/metadata/:guid/properties endpoint) and store those in your own database/system, where they can be indexed and exposed through a more powerful query mechanism. Sorry for the bad news ...

Felipe
  • 4,325
  • 1
  • 14
  • 19
  • Well, right now I do a workaround where I search twice and compare the two results to get the id's that are in both arrays. I'm aware that this is not the optimal way, but it gets me the results I need at the moment. But thank you for the really quick answer! Will this feature be expanded for a combined query in the future or how does the roadmap look? – stonecompass Jan 10 '18 at 11:16
  • 1
    Your approach is correct, that would be the only way to do it at the moment if you want to keep all your logic client-side, that was somehow implied by my answer... As far as I know there is no plan to provide such feature in the near future. – Felipe Jan 10 '18 at 14:01
  • Okay, but thanks again for the very quick response! I really appreciate it. – stonecompass Jan 11 '18 at 08:39