WeStandWithUkraine

8 years ago
35
Topic
Hi

What is the right way to perform a seach on a fieldX (that is on a LIST) please?
just putting the fieldx in the seach form does'nt work: seblod finds nothing

again the problem comes from the fact the fieldx is upon a LIST field: only the ID are then stored

thanks

cyril

Get a Book for SEBLOD
178 Posts
Jeka
8 years ago
0
Level 1
Hi.
In your search type configuration go to 3 ( Match and Stage ) press + and choose your field x collection.
8 years ago
0
Level 1
Thanks Jeka!

cyril
74 Posts
Jürgen
8 years ago
1
Level 1
Unfortunately this works only for 1 groupX or fieldX. If you have more than one in your content type it is not possible to search all :-(
8 years ago
0
Level 2
Hi Jürgen
Are you sure of it please ? Did SEblod confirm it ?
thanks
cyril
74 Posts
Jürgen
8 years ago
0
Level 1
Hello Pulsarinformatique,

this is my experience.
I have created a very complex content type which includes 3 groupX fields with a lot of fields in it. I have tried to include all the three groupX in the search type, but it was only possible to select one of them. For this selected groupX the search works fine.
What I wanted to say is that you are not able to select multiple groupX - its only a select simple field with one choice - this is what I found out. I havent tried it with fieldX (because I dont use it), but I guess it will be the same.
No I havent posted it in the tracker, but I will....
Maybe you try it on your own, and if you will find a possibility - please post it here.

Best regards

Jürgen
8 years ago
1
Level 1
Hi Jürgen

Even with one fieldx I can't make it work. here what I did:

The DOC content type has a doc_type 'simple select' field with 4 values:
type1=00
type2=01
type3=02
type4=04

The doc_type field is created but not present in the admin form. A doc_types fieldX is however present in the admin form.
the doc_types fieldX naturally calls the doc_type field

In the search form I put the doc_types fieldx and with the (3) button (match and stage) I set the collection on... itself (the only fieldX).

I found weird to have to precise the fieldx searches on itself though!

Obviously the search result doesn't care about this fieldX and everything behaves as if it was not present.

any idea please?

thanks

cyril
74 Posts
Jürgen
8 years ago
0
Level 2
Hi cyril,

as mentioned above I havent tried it with field x but with group X.

An important step to make groupx (and maybe fieldx too) searchable you have to told the search type that you want to search in these field types.
In this case you have to go to the search form in the backend.
There you got the various buttons on the right side of the fields (1 to 7). Number 3 is called "match + stage". Push this button. Look at the search fields in your search form. There you will find a plus (+) beside the match value. If you click on this plus a new window opens. In this window a select simple called collection is visible. THIS IS YOUR CONNECTION TO YOUR GROUPX OR FIELDX. Choose your groupx or field x and this field will be also searched too.
Now Seblod includes your fieldx or groupx in your search.

I hope this makes it a little bit clearer.

Best regards Jürgen
8 years ago
0
Level 1
Yes Jürgen, This is what I did but without success

We built hundreds of search lists in seblod but never on fieldX. 

In the search form (search tab) we put the fieldx field. Then on the (3) button we clicked on the "+" to set the fieldx (again !) 
Did I miss something?

thanks

cyril

74 Posts
Jürgen
8 years ago
0
Level 1
Hi Cyril,

dont put your fieldX to the search type. You have to put the field inside your field x to the form. In your case the select simple with the four values, put the match + stage of this field to "exact", push the plus button and then choose your fieldx of the collection.

In addition you can add a live value to your form. F.e. if you want to show only articles which matches "type1" you have to choose this for your live value.
Now only articles with this value should be displayed.

As a workaround:
If it doesnt really work with fieldx, you can change the fieldx to a groupx field. Now the groupx has only one field inside (your select simple), but it doesnt matter. Try the same. I know that it works with groupx because I have done it before.

Best regards Jürgen

8 years ago
1
Level 1
Hi Jürgen

I tried it as you wrote ... but now when I select something in the simple select list, I get 'no result found'. I tried several matching criteria with the same result.

I didn't try the groupx though, I will but I find weird that the fieldx collection call doesn't work

cyril
74 Posts
Jürgen
8 years ago
0
Level 2
Did you have added the cck field with the content type to the search form???
In your case you must have the cck field + the select simple field as minimum in your search form to get results.

74 Posts
Jürgen
8 years ago
0
Level 1
I have an error in one of my previous postings.
Your fields have the values like

type1=00
type2=01
type3=02
type4=04

so you have to put a live value to 00 or 01,... and not to type1, type2,... only if a live value is needed. If you are searching via a form, you dont need the live value.
8 years ago
1
Level 1
Hi

Of course I had the CCK field set to the conteny type in the search form and of course we tried it as a form so we don't need live values for the list items... but it didn't work

the simple select field is as you described.
in the search form we only have the CCK anf simple select fields. The CCK live value is set to the right content type. We know it because without selecting something in the simple select we get all the right results.

in the item view I display the fieldX to be sure to see that each item really has its fieldX filled

in the (3) button on the simple select I set the fieldX as the collection but as soon as I select something in the simple select I got "no result found"

cyril




46 Posts
Castor
8 years ago
0
Level 2
Hi Cyril,
Please do not use the Field-X (Group) field in the search form but another field a normal text field for example or as in your case a simple select. Point the storage to your Field-X (Group). This filed has a storage in this form f.e. Custom|Article|uploads[dokumentdatei] - Choose the right match (Button 3) and point with Button + to your Field-X (Group).
Best regards
Castor
8 years ago
1
Level 1
Castor

in the search form I didn't put the fieldX (that calls the simple select field) but the original simple select field. 

I also set the (3) match button with the (+) to the FIELDX
The storage of the simple select field (whose name is ge_doc_type)  is standard/article/ge_doc_type

cyril
46 Posts
Castor
8 years ago
0
Level 2
Salut Cyril,
Et voila. Field-X never use standard-storage. Please try custom-storage. See please http://www.seblod.com/resources/tutorials/how-to-use-plugin-field-fieldx
Best regards
Castor
74 Posts
Jürgen
8 years ago
0
Level 1
As far as I know, fieldx is only custom storage. So put the storage to custom/article/introtext or custom/article/introtext[ge_doc_type] and try it once more.

The advantage of storing it in the custom/article/introtext[ge_doc_type] format instead of custom/article/introtext is that you can call this field specific in other content types if needed because you add the field name. But this is another topic.

Best regards
8 years ago
1
Level 1
Thanks for all your efforts but DID YOU READ what I wrote ?

I gave you the storage for the original field (simple select field) NOT the fieldX which has a custom storage in the introtext

cyril
74 Posts
Jürgen
8 years ago
0
Level 2
sorry, put the select simple storage to none!!
8 years ago
2
Level 1
Sorry but when you create a simple select field (let's call it myfield), even if you select standard/article without anything in the last column, when you save it and come back you have standard/article/myfield which corresponds to the cck_store_form_MYContentType table

cyril
74 Posts
Jürgen
8 years ago
0
Level 2
No you misunderstood. You have to put the whole storage to "none", you can select this in the dropdown of the storage field!
46 Posts
Castor
8 years ago
0
Level 2
Hi Cyril,
Your simple-select storage has to point to the storage of your field-x. Otherwise this will not work. I have tested your problem. Try Simple-select with your params with storage from field-x - match any words and button + points to field-x (button 3) - it works fine.

Je te recommande vraiment de lire le totorial. Ton champ de stockage n'est pas correctement formé.


Best regards
Castor
8 years ago
1
Level 1
first Thank you for your time!

ok, I set the whole storage of the simple select to NONE
the storage of the fieldx is still custom/article/introtext

I saved again the 3 contents I created just to be sure they behave correctly. 

in the search form under the (3) button the match criteria is 'exact' with the fieldX assigned to the (+) button.

When I search on the front end whatever I choose in the simple select field I get ALL the 3 contents.

thanks

cyril

74 Posts
Jürgen
8 years ago
0
Level 2
Strange! Try to put another match option as "exact" fe. permissive default.
108 Posts
nycxav
8 years ago
0
Level 1
Hi, 
Did you find a solution, I'm struggling the same way with Group X search, I have storage to none for sub fields and custom for the Group X itself, I have used the subfield in the subform and added GroupX field to collection in the Match area. 
The CCK value is the parent content type (not the Group X but the content type in which the Group X is embedded)
The filter doesn't filter anything, every single record is returned regardless of what I capture in the subfield. 
Thanks.
108 Posts
nycxav
8 years ago
1
Level 1
Hi, 
I managed to get it work. In order for the search criteria on Field X and Group X to work, the subfields must NOT have storage set to "None" in spite of what I have read in some posts here. They must be set to Custom | Article | introtext[subfieldname] 
It now works for both Field X and Group X
X.
39 Posts
kwoychesko
8 years ago
0
Level 2
In the Custom Storage section of http://www.seblod.com/resources/tutorials/how-to-manage-fields-storage Seblod says: "do not use the column 'introtext' to store your FieldX and GroupX fields. You can store them anywhere else.'

So will nycxav run into trouble storing them here?
332 Posts
Kenneth
7 years ago
1
Level 1

Hmm.. another field x search problem thread - unsolved.

Managed to find a solution, cyril?

7 years ago
0
Level 2

Hi Kenneth

There are always solutions but to get performance and precise searches on fieldX/GroupX it is always difficult.

The only real solution would be Sebod considers a groupx not as an embedded object but as as linked object. 

Cyril

332 Posts
Kenneth
7 years ago
0
Level 1

Hi again, and thanks for the answer.

Since I posted and up until 5 minutes ago it was unsolved. But now it's solved.

The setup:

Content type: simple select field repeated with a field x.

In search view: a simple select field as filter.

Works like a charm!

I'll try to duplicate it and set it up again. If the process solves it again then I know the excact steps and will share them here.

332 Posts
Kenneth
7 years ago
0
Level 1

Yes. Success.

This is the steps done to accomplish it:

#1 I go to the content type and create a simple select field and add it with values. See screenshots to see my exact values before clicking save and close for the simple select field.

#2 After saving and closing this field I found it necessary to save the content type as well, so that the tables in the database updates.

#3 When the content type is saved it's time to add the field x. The key element here is the storage type. I have custom->free and select the content type table and the correct field for simple select. See screenshot.

Also, remember placing the "Field *" with the value of your simple select field.

That's it for the content type. You can now open to edit some of them and add your new values to the content and save it. Then we'll setup search and see that it works.

#4 Go to list and search type and setup a search view for the content type. As normal, add CCK field (if it's not there - it should be).

Then add the simple select field and select it as filter. Go to tab 3 and have it on permissive search. Push the + button and select your field x. 

Save the list and search type. 

It should now work.

332 Posts
Kenneth
7 years ago
2
Level 1

If someone follows the steps and succeeds as well, please tell. I would like to make a tutorial out of this, then...

7 years ago
1
Level 2

Hi Kenneth

I really must have missed something. 

I tried it on J3.3.6 + seblod 3.5.0 but when I try to create content I got some error message and the content doesn't show up in the article manager. When I try to create a new one I get another error:

1062. Duplicate entry '0' for key 'PRIMARY' SQL=INSERT INTO `puls_cck_store_form_test_fieldx` (`test_text`) VALUES ('<br />::test_texts::1::/test_texts::<br /><br />::test_text|0|test_texts::sqdsqd::/test_text|0|test_texts::<br />')

my TEST_FIELDX content type only has the test_texts fieldX which calls the test_text TEXT field. 

I first created the content type with the simple test_text field so that the #__cck_store_form_test_fieldx table  is created  with the test_text column.

then I removed the simple content type, even set its storage to NONE and created the test_texts FieldX with the following storage


Custom / FREE / #cck_store_form_test_fieldx / test-text 

The tutorial shows a CUSTOM | ARTICLE | database_column_name [ unique_name ] storage but in your example your storage for the fieldX is very different

Thanks for your help

cyril

332 Posts
Kenneth
7 years ago
0
Level 3

Well, that's strange... :P Maybe that has something to do with me only being able to save one value, no matter how many times I repeat field x. I'll dig in deeper. This needs to be solved in my and. I'll post back with what I learn.

7 years ago
0
Level 1

Thanks Kenneth

Get a VIP membership