I'm trying to understand how to implement Lucene Search I downloaded through the App Store but the documentation's explanation is beyond my skill level. I have a basic understanding of how Mendix works and made a small app that does some basic things. I've completed the basic training to a certain extent. What I'm trying to achieve is a search box that can search through the names (and description) of two or three different entities. Below is my domain model. I'm trying to search through Servicepakket and Dienstenpakket's name and description.
I have used Lucene search in a project and it is very capable, but also takes some work to implement.
For the search you described, you can accomplish that with native Mendix capabilities in the following way:
Create a ListView that points to Dienstenpakket entity
In this ListView, you can put a layoutgrid to display the attributes you are interested in, including attributes from entity Servicepakket
Now open the Search options for this ListView, as highlighted in an example below:
In the dialog box that appears, you can specifiy many attributes to search on, including attributes from associated entities.
Now when you start your app, there will be a search box above the Listview, which performs a unified search across all of the attributes you specified. In my experience, this unified search happens very quickly.
Hope that helps,
Mike is right, you can use a listview for that. In case you want to use the free lucene version (which is not only free, but also easier to deploy)
You can create an after commit event microflow for "dienstenpakket" and one for "servicepakket". In that microflow you call the java-action updateIindex with parameters indexId: 0, anyObject: dienstenpakket or servicepakket and searchText: $dienstenpakket/naam or $servicepakket/naam.
Create an assocation from searchResult to "dienstenpakket" and "servicepakket".
In a search microflow create searchCommand with indexId 0, Query: Text to search. Call SearchIndex with that parameter and the referenceSet searchCommand_searchResult is a list of results. Voila.
In case of existing you can update the index data just loop over dienstenpakket in batches (limit/offset) and call ACo_DienstenPakket from point 1.
BTW: read the installation guidelines for the after startup/before shutdown stuff.