Skip to content

Commit d470023

Browse files
committed
readme and show button in tree view
1 parent d2105be commit d470023

15 files changed

Lines changed: 370 additions & 23 deletions

typesense_ir_exports/README.rst

Lines changed: 139 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ Typesense Serializer Ir Export
3030

3131
Use Exporter (ir.exports) as serializer for connector_typesense
3232

33-
Each ir.exports records is converted into JSON and JSON data get indexed into the Search Engine.
33+
Each ir.exports records is converted into JSON and JSON data get indexed
34+
into the Search Engine.
3435

35-
Data can be String, Integer, Float, Lists, and Relations in the form of Object.
36+
Data can be String, Integer, Float, Lists, and Relations in the form of
37+
Object.
3638

37-
Thnaks to the dynamic Schema configuration we can add new fields or remove without breaking the Schema.
39+
Thnaks to the dynamic Schema configuration we can add new fields or
40+
remove without breaking the Schema.
3841

39-
Binary data like images are sent as string, but better if we use external filestore to use images related external urls.
42+
Binary data like images are sent as string, but better if we use
43+
external filestore to use images related external urls.
4044

4145
.. IMPORTANT::
4246
This is an alpha version, the data model and design can change at any time without warning.
@@ -48,6 +52,133 @@ Binary data like images are sent as string, but better if we use external filest
4852
.. contents::
4953
:local:
5054

55+
Configuration
56+
=============
57+
58+
You need to have typesense search engine running and successfully
59+
connected to odoo.
60+
61+
Make sure to have ``connector_search_engine`` and
62+
``connector_typesense`` modules installed.
63+
64+
SE Index Config
65+
---------------
66+
67+
Transition to: Search Engine > Configuration > Index configurations
68+
69+
Make sure to have this search index configuration in a new record:
70+
71+
::
72+
73+
- Name: give it a unigue name
74+
- Body Str:
75+
76+
.. code:: json
77+
78+
{
79+
"name": "ts_products_collection",
80+
"fields": [
81+
{
82+
"name": "id",
83+
"type": "string"
84+
},
85+
{
86+
"name": "name",
87+
"type": "string"
88+
},
89+
{
90+
"name": ".*",
91+
"type": "auto",
92+
"optional": true
93+
}
94+
],
95+
"enable_nested_fields": true
96+
}
97+
98+
SE Backend
99+
----------
100+
101+
Transition to: Search Engine > Configuration > Backends
102+
103+
Create a backend record, and create an index line with values:
104+
105+
::
106+
107+
- Model: select the model you want to index
108+
- Serializer Type: Exporter
109+
- Exporter: select or create a new one and set
110+
- Resource: model technical name you want to index
111+
- Index lines: each line a technical name of the field of interest
112+
- Config: select or create the config se index record mentioned above
113+
114+
You can create and manage exporter templates through a button in the
115+
tree view once you click on the exporter or the button under the
116+
``exporter_id`` field in the se.index form view.
117+
118+
Media
119+
-----
120+
121+
|Backend Configuration|\ {width=300}
122+
123+
|Exporter Dialog Button in Tree View|\ {width=300}
124+
125+
|Exporter Form View View|\ {width=300}
126+
127+
|Exporter Dialog|\ {width=300}
128+
129+
.. |Backend Configuration| image:: https://raw.githubusercontent.com/OCA/search-engine/16.0/typesense_ir_exports/static/img/backend.png
130+
.. |Exporter Dialog Button in Tree View| image:: https://raw.githubusercontent.com/OCA/search-engine/16.0/typesense_ir_exports/static/img/exporter_dialog_button.png
131+
.. |Exporter Form View View| image:: https://raw.githubusercontent.com/OCA/search-engine/16.0/typesense_ir_exports/static/img/exporter_form_view.png
132+
.. |Exporter Dialog| image:: https://raw.githubusercontent.com/OCA/search-engine/16.0/typesense_ir_exports/static/img/exporter_dialog.png
133+
134+
Usage
135+
=====
136+
137+
Simple Quick User Friendly Usage
138+
--------------------------------
139+
140+
The key of the module is the user friendly usage of ir.exports to
141+
serialize data and resolve it for JSON.
142+
143+
Behind the scene everything is managed to jsonify:
144+
145+
::
146+
147+
- images bytes into string
148+
- images thumbnail into urls external or internal (any of them in sequence)
149+
- many2one relation into string
150+
- many2one inner fileds into object of key value pairs
151+
- many2many into list of inner strings or objects
152+
- intergers are indexed as integers
153+
- floats are indexed as floats
154+
- id is ESSENIALLY indexed as string and not as integer (typesene only)
155+
156+
If relational field has inner relational field and that also has inner
157+
relational field or data, no worries everything is managed smoothly.
158+
159+
Selecting fields and relations and inner relations is friendly handled
160+
by the exporter dialog.
161+
162+
You can remove or add fields as you wish, as indexing is updated, and if
163+
necessary recreated.
164+
165+
(recreating a collection only if a data type changes from string into
166+
object or vice versa, like having many2one relation and then having the
167+
same relation with inner fields of it)
168+
169+
Media
170+
-----
171+
172+
|se index form view with exporter button|
173+
174+
|exporter dialog complicated tree|
175+
176+
|serialized json data from exporter related record|
177+
178+
.. |se index form view with exporter button| image:: https://raw.githubusercontent.com/OCA/search-engine/16.0/typesense_ir_exports/static/img/se_index_form_with_exporter_button.png
179+
.. |exporter dialog complicated tree| image:: https://raw.githubusercontent.com/OCA/search-engine/16.0/typesense_ir_exports/static/img/dialog_tree_content.png
180+
.. |serialized json data from exporter related record| image:: https://raw.githubusercontent.com/OCA/search-engine/16.0/typesense_ir_exports/static/img/serialized_data_from_exporter.png
181+
51182
Bug Tracker
52183
===========
53184

@@ -62,17 +193,17 @@ Credits
62193
=======
63194

64195
Authors
65-
~~~~~~~
196+
-------
66197

67198
* Kencove
68199

69200
Contributors
70-
~~~~~~~~~~~~
201+
------------
71202

72-
* Mohamed Alkobrosli <malkobrosly@kencove.com>
203+
- Mohamed Alkobrosli malkobrosly@kencove.com
73204

74205
Maintainers
75-
~~~~~~~~~~~
206+
-----------
76207

77208
This module is maintained by the OCA.
78209

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
You need to have typesense search engine running and successfully connected to odoo.
2+
3+
Make sure to have `connector_search_engine` and `connector_typesense` modules installed.
4+
5+
## SE Index Config
6+
7+
Transition to: Search Engine > Configuration > Index configurations
8+
9+
Make sure to have this search index configuration in a new record:
10+
11+
- Name: give it a unigue name
12+
- Body Str:
13+
14+
```json
15+
{
16+
"name": "ts_products_collection",
17+
"fields": [
18+
{
19+
"name": "id",
20+
"type": "string"
21+
},
22+
{
23+
"name": "name",
24+
"type": "string"
25+
},
26+
{
27+
"name": ".*",
28+
"type": "auto",
29+
"optional": true
30+
}
31+
],
32+
"enable_nested_fields": true
33+
}
34+
```
35+
36+
## SE Backend
37+
38+
Transition to: Search Engine > Configuration > Backends
39+
40+
Create a backend record, and create an index line with values:
41+
42+
- Model: select the model you want to index
43+
- Serializer Type: Exporter
44+
- Exporter: select or create a new one and set
45+
- Resource: model technical name you want to index
46+
- Index lines: each line a technical name of the field of interest
47+
- Config: select or create the config se index record mentioned above
48+
49+
You can create and manage exporter templates through a button in the tree view once you
50+
click on the exporter or the button under the `exporter_id` field in the se.index form
51+
view.
52+
53+
## Media
54+
55+
![Backend Configuration](../static/img/backend.png){width=300}
56+
57+
![Exporter Dialog Button in Tree View](../static/img/exporter_dialog_button.png){width=300}
58+
59+
![Exporter Form View View](../static/img/exporter_form_view.png){width=300}
60+
61+
![Exporter Dialog](../static/img/exporter_dialog.png){width=300}
File renamed without changes.
File renamed without changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Simple Quick User Friendly Usage
2+
3+
The key of the module is the user friendly usage of ir.exports to serialize data and
4+
resolve it for JSON.
5+
6+
Behind the scene everything is managed to jsonify:
7+
8+
- images bytes into string
9+
- images thumbnail into urls external or internal (any of them in sequence)
10+
- many2one relation into string
11+
- many2one inner fileds into object of key value pairs
12+
- many2many into list of inner strings or objects
13+
- intergers are indexed as integers
14+
- floats are indexed as floats
15+
- id is ESSENIALLY indexed as string and not as integer (typesene only)
16+
17+
If relational field has inner relational field and that also has inner relational field
18+
or data, no worries everything is managed smoothly.
19+
20+
Selecting fields and relations and inner relations is friendly handled by the exporter
21+
dialog.
22+
23+
You can remove or add fields as you wish, as indexing is updated, and if necessary
24+
recreated.
25+
26+
(recreating a collection only if a data type changes from string into object or vice
27+
versa, like having many2one relation and then having the same relation with inner fields
28+
of it)
29+
30+
## Media
31+
32+
![se index form view with exporter button](../static/img/se_index_form_with_exporter_button.png)
33+
34+
![exporter dialog complicated tree](../static/img/dialog_tree_content.png)
35+
36+
![serialized json data from exporter related record](../static/img/serialized_data_from_exporter.png)
2.8 KB
Loading

0 commit comments

Comments
 (0)