Forums / Developer / how to search into XML block?

how to search into XML block?

Author Message

Dhaval Patel

Sunday 08 March 2009 9:22:01 am

hello,

I want to do search operation on XML block.

I have one class and it has one field of type XML block,

but I cannot use "attribute_filter" in fetch function as it is restricted to use on "XML block"...

so what is the other way to search into xml block into fetch function ?

and one more question that I have one more field of type "object relation", i want to search on that also, but it compares only contentobject_id only.

so how do i search the text on "object relation" type field?

Please suggest me what to do to make search possible?

Thanking you ,

Dhaval Patel

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in

Fátima Chapri

Monday 09 March 2009 2:34:09 pm

Hi Dhaval,

Instead of "attribute_filter", you can use "class_attribute_id". Have a look at this http://ez.no/doc/ez_publish/technical_manual/3_9/reference/modules/content/fetch_functions/search

Dhaval Patel

Monday 09 March 2009 10:38:51 pm

thank you Fátima

thanks a lot,

{def $search=fetch( 'content', 'search',hash( 'text',     $searchq,
						                          'class_attribute_id', array( '213', '215', '449', '453', '214') ,
												  'limitation' , array()
												 ) )
}

this works for both xml block as well as object relation type fields.

but this will search for full word like if any field contains "welcome", then if we do search on "wel" or "come" then it doesn't search. we have to give full search.

I tried with

concat('*',$searchq,'*') 

also, but it doesn't work.

it is not a big issue, but i faced this.

Once again, thanks a lot.

Warm regards,

Dhaval Patel

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in