1
Cozzie
How does isearch work?
  • 2008/3/12 2:50

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Hi there, I'm wondering if someone can explain to me how isearch records the keywords searched.

I've installed the module and its great but I have a tailor-made search for one module on my site, this search is not the XOOPS search but it is the main search I use on the site. I want to see if it is possible to get isearch recording the searches made.

So far I've changed the search template script so that the non-xoops search is made from the block. It works well and the auto-complete works well but although searches are made they aren't recorded by isearch.

Does anyone know how/if I can do this?

Thanks a lot for any help

2
Eskimo-mo
Re: How does isearch work?
  • 2008/3/13 1:51

  • Eskimo-mo

  • Just popping in

  • Posts: 22

  • Since: 2008/3/12


Hello, I have a similar problem

I'm trying to get isearch to record multiple word searches.

So if someone types in 'beautiful women' it will record the search as that not as a search for beautiful and another search for women

Can this be done? I really can't figure it

Thanks

3
iHackCode
Re: How does isearch work?

when you do a search with search.php or the textbox in the block. you are doing a search through all the modules, including the isearch module. it is this that makes it so these keywords are recorded. the search function in isearch stores the keywords that were queried.

the function is isearch_search in modules/isearch/include/search.inc.php

when you do an EXACT search the whole string becomes the keyword (the script doesn't separate it). you could modify the isearch_search function to check if $queryarray is an array and if it is not then break it up with,(example from search.php) preg_split('/[\s,]+/', $query); , and the rest of the function will take care of the rest.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

4
Cozzie
Re: How does isearch work?
  • 2008/3/17 3:14

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Thanks a lot Bandit!

5
Cozzie
Re: How does isearch work?
  • 2008/4/18 9:21

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


I'm afraid I need help again.

I've made a custom-built search for one of my modules. Its the main module of the site (the XOOPS search couldn't be adjusted to fit).

It works great, i just made the php search script and added the mainfile, header and footer pathways.

BUT the problem is searches made obviously aren't recorded by isearch and I REALLY HAVE TO MAKE THEM BE.

I've tried to include the search.php and also tried the isearch/include/search.inc but my php knowledge is not good enough and I can't make it happen

Can anyone help me? Thanks a lot!

6
trabis
Re: How does isearch work?
  • 2008/4/18 23:27

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Yes, try to include the isearch search.inc.php and call the function:

isearch_search($queryarray, $andor, $limit, $offset, $userid);

You have to populate those vars first.
The result of the function may be discarded.

7
Cozzie
Re: How does isearch work?
  • 2008/4/19 3:50

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


thanks trabis!

Sorry but how can I call those functions? Can you explain it?


8
trabis
Re: How does isearch work?
  • 2008/4/19 8:55

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Can you post you script here. It would be easier to tell you exactily what to do.

(to include that function you just have to paste it as it is)

9
Cozzie
Re: How does isearch work?
  • 2008/4/21 11:17

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


thanks trabis

I've PM'd the search code to you, hope that's ok

Thanks again!

Login

Who's Online

300 user(s) are online (213 user(s) are browsing Support Forums)


Members: 0


Guests: 300


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits