Comments (6)
@rakibtg any thaugths
from sleekdb.
@REDAL i think the best solution would be to run that logic in the application layer
from sleekdb.
@REDAL i think the best solution would be to run that logic in the application layer
can you give me an example ? please
from sleekdb.
@rakibtg ?! any help here Hasan
from sleekdb.
Hi @REDAL sorry for the late response.
You can see the order of execution here: https://sleekdb.github.io/#/execution-order
As you can see search
comes after join
.
That means you can do a join and search afterwards. For example:
$userStore = new Store("users", $dataDir);
$commentStore = new Store("comments", $dataDir);
$searchQuery = "SleekDB is the best database solution";
$users = $usersStore
->createQueryBuilder()
->join(function($user) use ($commentStore){
// returns result
return $commentStore->findBy([ "userId", "=", $user["_id"] ]);
}, "comments")
->search(['comments.0.title', 'comments.0.content'], $searchQuery)
->orderBy(["searchScore" => "DESC"])
->getQuery()
->fetch();
The example above will first join users
and comments
. Afterwards it will search the first joined comment of every user.
Unfortunately we currently haven't implemented wildcards like comments.*.title
. That's the reason why searching after a join probably will not do what you need.
from sleekdb.
from sleekdb.
Related Issues (20)
- Math & Logic operations HOT 2
- nested column select and distinct return empty array HOT 3
- simple join approach
- SleekDB Extension of builtin "named functions" by users
- Allow to use UUIDs as primary keys HOT 2
- How to Run SleekDB HOT 4
- JSON Wildcard Notation HOT 2
- Incorrect escaping of characters?
- Select with alias at join HOT 5
- Class 'SleekDB\Store' not found HOT 2
- Searching for value in array. HOT 2
- [Feature Request] Simple key-value lookup HOT 1
- [Feature Request] Searching from multiple stores HOT 1
- [SUGGESTION] please set config:timeout default to false HOT 2
- How to set special chars? HOT 7
- Use SleekDB as a readonly store HOT 2
- updateById method undefined HOT 3
- Group by Date
- replace file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sleekdb.