Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-7885

Improve Coverage for Queries and Filters


    • Type of Documentation:


      Work on LRDOCS-7605 revealed gaps in coverage for the Queries and Filters documentation.
      Example: Explain the differences between filtering with searchRequestBuilder.postFilterQuery and booleanQuery.addFilterQueryClauses. with examples. Currently only a cursory explanation of post filter queries are provided.

      A Liferay Learn article with this outline has been planned based on discussion and exploration that happened as part of LRDOCS-7605:

      Building Search Requests

      1. Examine a Running Example Search

      • Minimum code to show SearchRequest and SearchResponse and the builders: the common elements to cover first
      • Start with doing a simple keyword search with no custom query
      • [No coding steps: the base module holds this code, we just explain]

      2. Using the SearchContext

      • Cover the meaning of companyId
      • Explain some of the SearchContext fields and attributes and their impact on the end query
      • [Steps to use entryClassName on SearchContext to limit what models we search in - still with no custom queryset]
      • Deploy and Test

      3. Inspecting the Request String

      • Show search request query JSON snippets to help the developer connect the building blocks with parts of the generated query
      • [Steps for seeing the Request String, with explanation]
      • Deploy and Test

      4. Building Custom Queries

      • Demonstrate differences/similarities between setting something in the SearchContext and creating a query for the same field.
      • Filter vs. Query context
      • [Steps for adding at least one query and filter to the request]
      • Deploy and Test

      5. Conclusion

      6. Related Topics


          Issue Links



              • Assignee:
                russell.bohl Russell Bohl
                russell.bohl Russell Bohl
                Subject Matter Expert:
                Tibor Lipusz
                Participants of an Issue:
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created:

                  Zendesk Support


                    Version Package