1

I'm exploring the Query builder component of Sensenet. enter link description here

On "Query Wizard" it is possible to search by "Content Type" and "Fields" (of the Selected Content)... Imagine that I have a Document Library, and the user customized the fields of his library (add more fields). Is it possible to search by the custom fields on the query builder? should I customize the Query builder component?

Aniko Litvanyi
  • 2,109
  • 1
  • 21
  • 25

1 Answers1

2

QueryBuilder has 2 tabs, one for a click-and-pick query ("Query wizard"), and one for editing the query ("Query editor"). If you know the name of the field you want to query, then the answer is "Yes". The QueryBuilder should pull all of the content and fields for your content. Also, if you have a custom Content created by defining a new Content Type then all of those fields will be exposed in the QueryBuilder.

As an example, if you were searching Documents (of type File) and the custom field name was MyCustomField and you were searching for the value foo in this field, the query in the Query editor would look something like this:

TypeIs:File AND MyCustomField:foo

You can toggle between the wizard and editor to validate the query. Please submit another SO question if you need to know how to query for the name(s) of the custom field(s).

Thane Plummer
  • 7,966
  • 3
  • 26
  • 30
  • Thanks for your answer. But in the case that I want to search by the custom field defined on the views of a document library... how would be the query string? – Luciano Valinho Oct 19 '17 at 15:41