I have a problem with Flexible Search, I have a dynamic attribute ("available parts") in the TimeSlotInstance entity, I would like to show the value of this dynamic attribute in the "remaining availability" column of my query (obviously for each time slot instance), how can I do this? Thank you all.
Asked
Active
Viewed 560 times
1 Answers
1
You cannot use FlexibleSearch with dynamic attributes. You can only FlexSearch attributes that can be saved in the database. i.e. non-dynamic attributes.

geffchang
- 3,279
- 2
- 32
- 58
-
so which strategy should I use? – John Jul 19 '22 at 12:10
-
@John Use Java code to get the data. i.e. Use the Model's getter method of the dynamic attribute – geffchang Jul 19 '22 at 12:26
-
I did, I basically took all the timeslotinstances of a given day (via a trivial query), I cycled this list and for each element I get the value of the dynamic attribute, but how can I put this value in the column where it should be? – John Jul 19 '22 at 12:48
-
@John You can't get it via FlexSearch, because FlexSearch gets data from DB. Dynamic Attribute values are not saved in DB; they are configured as `persistence=dynamic` in items.xml. They're calculated on the fly using Java. So, you need to use Java to get those values. – geffchang Jul 20 '22 at 15:23
-
Hi, yes but how could I do put those value in a column? Basically, I have to attach a cvs file containing values including 'area', 'day', 'slotAvailable15/17' and 'slotAvailable18/20'. The query I made initially returns timeslots which I filter by slot15/17 and slot18/20 but how do I populate the 4 columns and pass them to the csv? – John Jul 21 '22 at 14:04