'searching Mysql table with Elasticsearch
Lets say I have the following "expenses" MySQL Table:
| id | amount | vendor | tag |
|---|---|---|---|
| 1 | 100 | foo | |
| 2 | 450 | GitHub | bar |
| 3 | 22 | GitLab | fizz |
| 4 | 75 | AWS | buzz |
I'm building an API that should return expenses based on partial "vendor" or "tag" filters, so vendor="Git" should return records 2&3, and tag="zz" should return records 3&4.
I was thinking of utilizing elasticsearch capabilities, but I'm not sure the correct way..
most articles I read suggest replicating the table records (using logstash pipe or other methods) to elastic index.
So my API doesn't even query the DB and return an array of documents directly from ES?
Is this considered good practice? replicating the whole table to elastic? What about table relations... What If I want to filter by nested table relation?...
Solution 1:[1]
You could use .traverse or .traverseVisible making sure that the object is a Mesh.
renderer.onBeforeRender(() => {
box.traverse((obj3D) => {
if (obj3D instanceof Mesh) {
// Make sure this object is a mesh.
obj3D.rotation.x += 0.01;
}
})
});
Callback would be invoked in the current object (box in this case) and all its descendants.
https://threejs.org/docs/index.html?q=object#api/en/core/Object3D.traverse
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lucas David Ferrero |
