altica
Posts: 31
Joined: Thu Mar 19, 2009 12:07 am

Postby altica » Wed Jun 29, 2011 11:35 am

Is there a way to have search parameters read from a text file rather than from the Search Channel setup parameters?

This would be really useful as I could then generate the text file dynamically from another application
Graham

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Wed Jun 29, 2011 1:00 pm

altica wrote:Is there a way to have search parameters read from a text file rather than from the Search Channel setup parameters?

This would be really useful as I could then generate the text file dynamically from another application

Not really but you can always hack up the .CHANNEL file. Just make sure Awasu is not running when you do this.

altica
Posts: 31
Joined: Thu Mar 19, 2009 12:07 am

Postby altica » Wed Jun 29, 2011 1:52 pm

Where do I find the .CHANNEL file?
Graham

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Wed Jun 29, 2011 2:32 pm

altica wrote:Where do I find the .CHANNEL file?

Awasu's file structure is described here.

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Wed Jun 29, 2011 2:34 pm

support wrote:you can always hack up the .CHANNEL file.

/taka hangs his head in shame.

You can also use the Awasu API to manipulate channels.

Old habits die hard :oops:

altica
Posts: 31
Joined: Thu Mar 19, 2009 12:07 am

Postby altica » Wed Jun 29, 2011 2:47 pm

Awasu API Search Operations seems the way to go - just need to create a client to do this!

Do you think it's possible using Excel & VBA?
Graham

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Wed Jun 29, 2011 6:12 pm

altica wrote:Do you think it's possible using Excel & VBA?

Should be fine. As long as you can send an HTTP request and read the response, you should be OK to go.

altica
Posts: 31
Joined: Thu Mar 19, 2009 12:07 am

Postby altica » Wed Jun 29, 2011 7:32 pm

Got Excel to talk to Awasu API using VBA. Couldn't figure out how to use Token so turned it off in Awasu

The command I send is : http://localhost:2604/channels/list

I assumed the same using the token would be:

http://localhost:2604/token?t=XXXX/channels/list but it doesn't seem to work

Could you let me know the format please?

PS I think this has huge potential!
Graham

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Thu Jun 30, 2011 12:35 am

altica wrote:http://localhost:2604/token?t=XXXX/channels/list but it doesn't seem to work

It should be http://localhost:2604/channels/list?token=XXXX

altica
Posts: 31
Joined: Thu Mar 19, 2009 12:07 am

Postby altica » Thu Jun 30, 2011 11:11 am

Thanks for that - I'm getting there slowly!

What is the fortmat for the minScore command? Is it sent to the Awasu API as a separate string or is it tagged to the end of a search command?


I've tried:

http://localhost:2604/search/minScore=40

and

http://localhost:2604/search/query?ms=40


but neither seem to work
Graham

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Thu Jun 30, 2011 11:47 am

The Awasu API is fairly sophisticated and complex, so trial and error is going to be slow going :-)

If you want to change a channel's setting, first use $channels/list to find out what channels are in your Awasu and their ID's.

Then, call $channels/update, specifying the ID(s) of the channel(s) you want to update (in the URL parameters), and what settings you want to change (in the HTTP POST data). In your case, if you want to change the min score setting, you need to include a <scoreCutoff> tag.

To find out the format of the XML that needs to go in the HTTP POST data, call $channels/list with a verbose=1 parameter, to get the full details for each channel. The XML structure that is returned is the same structure you need to submit when either creating new channels, or updating existing ones.

Some examples here.

altica
Posts: 31
Joined: Thu Mar 19, 2009 12:07 am

Postby altica » Thu Jun 30, 2011 12:03 pm

Hi

Not sure if this answers my question.

Your documentation for $/search/query details minScore (ms) Minimum score for search results (0-100)

How do I use this in an API call which seraches the Awasu database?
Graham

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Thu Jun 30, 2011 12:19 pm

altica wrote:How do I use this in an API call which seraches the Awasu database?

Ah, sorry. Your OP was talking about modifying search channel configurations so that's what I answered about :-)

The general format of a URL that accepts parameters is

Code: Select all

http://foobar.com?arg1=val1&arg2=val2&arg3=val3...etc...

So, to run an Awasu search, you could submit something like this:

Code: Select all

http://localhost:2604/search/query?q=bananas&minScore=40&pageSize=20

altica
Posts: 31
Joined: Thu Mar 19, 2009 12:07 am

Postby altica » Thu Jun 30, 2011 12:34 pm

Thanks for that - the world is at peace once more!
Graham

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Thu Jun 30, 2011 1:39 pm

altica wrote:the world is at peace once more!

Ah, if only my life were so simple.

Sigh...


Return to “Awasu - General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests