Iam new in elasticsearch.I integrated elasticsearch to my existing laravel app.
I have two tables.parents and childrens. When each parent created ,it create a document with index name parent.same as childrens.., each childrens created creates document with index name childrens. I want to map these two model in elasticsearch. how i will implement this. i used "tamayo/laravel-scout-elastic": "^3.0", to integrate with my laravel app.
Please help.thanks in advance
Related
I'm new to laravel. I have UI design of search box. When I search search-term it will show data under the search box as a table. Initially it's only shows search box. How can I handle that kind of situation with laravel? Example Image
As #xNoJustice already said you can include a search package.
If you want to do it by yourself you are able to query each field of your Model for the search word.
For example you can search the Models like:
Model::where('xxx','LIKE','%'.$search_word.'%')
->orWhere('yyy','LIKE','%'.$search_word.'%')->get();
You will need to do this for each Model you want to be searched tḧrough and then pass all the results to your view.
In service now for reference, there's a field type called 'reference'. Now I need to create a multi-reference field. But I don't see any field type for it. Can we achieve the same using field type 'List'? If yes, How to achieve it in the UI and REST API?
Multi-reference means to search through multiple objects
FYI, I'm using Madrid version and Customer Service Plugin.
No, there is no such thing as multiple table reference Field. How should the system react, if you write eg. Incidents and Catalog Items in the same Field?
I would advice you to just make two Fields, each with it's own reference table.
If you really want multiple types of references to pick, you would have to create a new table, import eg. Incident and Catalog Item references into that table and create a reference Field to that table.
I have created two content type builder which are category and sub-category respectively. While adding sub-category I had define one relationship which is one-to-many.
After creating successfully, I found that the basic CRUD API has been created and it works fine.
Now I need to find data like if I pass category-id then it has to return me it's all sub-category list.
Well, for this I can also write API manually, But I thought that strapi provides a feature of relationship though it may have some way to fetch data from the relationship table. In my app, I had set up a project with MySQL.
Expected output: Need a way to fetch data from a relation without writing custom API. Looking for inbuilt feature of strapi.
You have to use deep filtering.
📚Here is the documentation https://strapi.io/documentation/3.0.0-beta.x/guides/filters.html#deep-filtering
So you will be able to do /categories?sub-category.id=[your id]
Currently we use Mysql as database for our multi-tenant web application, in order to improve our search we decided to move to ElasticSearch. We have an Entity in Mysql with some base fields and every tenant can define his own custom fields(can be of any data type) for that entity. What are the best practices for designing index in elastic search for above problems?
Will dynamic mapping work fine in the above case.
Elasticsearch is great tool to define custom fields, you simply can index data without define nothing.
In some cases you have to define fields mapping, for example in date field or Geo point field, if you don't mapping this field, elastic will not treat this field as you wish.
So if your custom fields is not date or Geo point you can allow tenant define custom fields.
The tentative goal is to allow form pre-population from Project entity to related Document entity. Notice that both are custom entities. The relationship between Project and Document is set properly:
And the mappings for this relationship are also set:
However, when we try to create a new Document for an existing Project. The fields are empty:
Why is the pre-population not working?
The out of box workings for mapping only works in the case of creating a record from a grid. If you're not doing this, you won't get the mapping.