Full Text Search Related Entites

Hello there,

I am dealing with a problem with the FTS, i searched in the DOCS was not really clear and didn’t found anything in the Forum neither.

I think is just a configuration from FTS.XML issue but im doing something wrong.

I have two Entities Vehicle and VehicleTest.
VehicleTest has a one to many relationship with vehicle.

When i search per a property of vehicle let says the BRAND or a PrivateVehicleKey, i want to have as result the Vehicles that fulfill that criteria and all the VehicleTest which have vehicles that fulfill this criteria.

My fts.xml for this two entities look like this:

for Vehicle

        
        <entity class="com.example.project.vehiclemanagement.entity.Vehicle">
            <include re=".*"/>
            <include name="brand"/>
        </entity>

for VehicleTest


        <entity class="com.example.project.testmanagement.entity.VehicleTest">
            <include re=".*"/>
            <include name="vehicle" />
        </entity>

Maybe in Vehicle the include name Brand is redundant but i was just trying stuff to have this work.

I hope i was clear.

Thank you in advance.

Nico

Hi!
Try to add the following block to your Vehicle FTS config:

<searchables>        
   searchables.add(entity.vehicleTest)   
</searchables>

This configuration will trigger the reindexing of the VehicleTest each time the Vehicle is modified.
You can read about it here: https://doc.cuba-platform.com/fts-6.5/fts_config.html

Hi Max, thank you for the answer, unfortunately it’s not working.
First, in vehicle i don’t have entity.vehicleTest, i have entity.vehicleTests because is one to many. One Vehicle many Tests.
I tried yesterday with only 400 vehicles and 500 Test with this configuration.

        <entity class="com.example.project.vehiclemanagement.entity.Vehicle">
            <include re=".*"/>
            <searchables>
                searchables.add(entity.vehicleTests)
            </searchables>
        </entity>

And it was indexing for hours and hours and in the end i don’t get the related neither.
I delete that configuration and change it to:

     <entity class="com.example.project.testmanagement.entity.VehicleTest">
            <include re=".*"/>
            <searchables>
                searchables.add(entity.vehicle)
            </searchables>
        </entity>

And didn’t work neither, what exactly is wrong?

If Vehicle has many VehicleTests then you initial configuration is correct. I’ve just tried this one in the test project, and it worked:

        <entity class="com.company.vehicles.entity.Vehicle">
            <include re=".*"/>
        </entity>
        <entity class="com.company.vehicles.entity.VehicleTest">
            <include re=".*"/>
            <include re="vehicle"/>
        </entity>

What is the problem with your search? What result do you get?

I tried yours and also not result :frowning:

The problem is: I search the vehicles per a intern key (this key is a property of vehicles), and in the results i see only the vehicles BUT i don’t see the Vehicle Test which are related with these vehicles, the app.log says LuceneIndexer adding document and i see how all the entities are added with no errors.

Then if a try the other way around like search per a VehicleTest property only give me the VehicleTest and not the Vehicles, but this one is not really important, for us what is really important is the possibility to search for a vehicle property and to have all the VehicleTest related as result.

Please attach a small project that demonstrates an issue and the search terms you use.

Thank you for the help i really appreciate it.
I just made a new project from the scratch, it is run over MSSQL server i attach you the .bak so you can restore with my examples.
Is quite simple vehicle and vehicle test similar to the real project i copy you config and when i search for the term:
FOR4539 which is a private key of vehicle only the vehicle is coming, and both vehicle and his respective test should appear.

PS: I’m doing, ReindexALL and then ProcessEntireQueue

project_test.zip (500.0K)

Now I see the problem. FTS doesn’t add links to entities that inherit BaseIdentityIdEntity to the index. I tried with StandardEntity - that’s why everything worked on my side. It’s definitely a bug, we’ve created an issue.

O i see, well i hope you can fix it soon, we really needed, and i think i can’t do any workaround because i have not access to the FTS code (Premium Addon) or ?

Our sistem is already in Production with a lot of data, so no chance to change it to HasUIID.

If there is any i can do to help, with the testing of what you do or something just let me know i have a lot of data waiting to be indexed haha.

Most likely, the fix will appear in platform 6.7. Platform 6.6 is in testing now and big modifications are not allowed there. As for the premium add-on source code, you have it. You can see it right in your IDE and, of course, you can override any Spring bean from premium add-on.

Nice thank you!!!

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-9362

Hi All,

I’ve facing same issue here,

Does this issue had been resolved ?

https://youtrack.cuba-platform.com/issue/PL-9362#tab=Comments

It will be fixed in v 6.8