Forum BigDB Table index property OR'ing load vs the default AND method

Discussion and help relating to the PlayerIO database solution, BigDB.

Table index property OR'ing load vs the default AND method

Postby deadbug » January 8th, 2015, 2:38 am

Hi,
I need to search any of 6 properties in a table object. IE. Maybe 2 of them, maybe 4 of them maybe all 6. I'm trying to use LoadRange to get users that have any of those 6 properties. I've created an index with each of the 6 properties. When I try to pass the data to pathIndex with "new object[] { null, null,null,itemtoSearch,null,null}" (in this example it would only search the 4th item and ignore the rest it) it throws an exception. I'm guessing turning off/on a search items in the index by passing null is not allowed?

How do you do OR searching logic? Seems everything in the index is using the AND for each index property.

I thought of creating an index for each property and doing a search for each one but there is a limit of 4 indexes per table. I need at least 6 plus more for potential other search functions.

Whats the best way I can accomplish this search?
deadbug
 
Posts: 35
Joined: November 1st, 2011, 1:35 am

Re: Table index property OR'ing load vs the default AND meth

Postby Guillaume » January 14th, 2015, 8:35 pm

According to BigDB API implementation, it seem very difficult to do a OR in only one request.

But just thinking about it, if you would be able to do an OR, it would take a little more time i guess, for searching about the different criteria possibilities.

I think, for the moment, the best way is to do multiple requests, according to your needs, and then merge your DataResults in the same list. Of course if you merge results, filter similar row ids.

But it's true that if you often have recurrent same data state, you may have performance loss because of loading data twice, in some way.

This said, i only say that if you are using BigDB from server side. Don't follow my advice if it's from client, otherwise it's just a suicide.
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: Table index property OR'ing load vs the default AND meth

Postby Henrik » January 28th, 2015, 5:49 pm

Sorry, BigDB does not support OR, and is not well suited to the kind of queries you want to do.

One way to work around it is to add a property to your objects that combines the values of the six other properties, so that you can index and search on that single property instead to get all objects that you want.
Henrik
.IO
 
Posts: 1822
Joined: January 4th, 2010, 1:53 pm


Return to BigDB



cron