Search box with document id

View: New views
3 Messages — Rating Filter:   Alert me  

Search box with document id

by Lou Parisi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

By default if I put a document ID (2180-DSY) into the daisy search box and search it does not recognize this as a daisy document and comes up with no matches.  Can anyone give some ideas if there is an easy way to customize the search to do this.  I found one post about customizing the search box button to do a full lucene search.  Perhaps something similar could be done to see if the search is daisy document format and if so then go to the specific document.  I'm not sure where to start so any help would be appreciated.

Re: Search box with document id

by Paul Focke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A quick hack would be to do this completely in client side javascript. So it would be a question of editing the search template to include your custom check on daisy document id. When you detect a document id you could send the browser to that document using the 'window.location=http://<host>/<daisy-site>/<document-id> ' command.
Or just type the document id in the address bar yourself instead of searching :-)

Paul

On Fri, Aug 14, 2009 at 12:13 AM, Lou Parisi <Lou.Parisi@...> wrote:

By default if I put a document ID (2180-DSY) into the daisy search box and
search it does not recognize this as a daisy document and comes up with no
matches.  Can anyone give some ideas if there is an easy way to customize
the search to do this.  I found one post about customizing the search box
button to do a full lucene search.  Perhaps something similar could be done
to see if the search is daisy document format and if so then go to the
specific document.  I'm not sure where to start so any help would be
appreciated.
--
View this message in context: http://www.nabble.com/Search-box-with-document-id-tp24960136p24960136.html
Sent from the Daisy - General mailing list archive at Nabble.com.

_______________________________________________
daisy community mailing list
Professional Daisy support: http://outerthought.org/en/services/daisy/support.html
mail to: daisy@...
list information: http://lists.cocoondev.org/mailman/listinfo/daisy


_______________________________________________
daisy community mailing list
Professional Daisy support: http://outerthought.org/en/services/daisy/support.html
mail to: daisy@...
list information: http://lists.cocoondev.org/mailman/listinfo/daisy

AW: Search box with document id

by jge :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I realized it with a small javascript

I have to sites with  /en/1234-www and /de/1234-www

in layout.xsl

<form onsubmit="return quicklink('{$basePath}')" action="{$basePath}/search" name="search">
  <input type="text" name="query" id="searchInput"/>
  <xsl:text> </xsl:text>
  <input type="submit" value="skin:layout.search" id="searchButton" i18n:attr="value"/>
</form>
 
 
The client javascript:

function quicklink(basePath){

var newURL=document.forms['search'].query.value;
var bQuicklink = false;
if (newURL.match("[0-9]{6}")){
        window.location.href = "/" + newURL;
        bQuicklink = true;
}else{

if ((newURL.indexOf("en/") == 0) || (newURL.indexOf("de/")) == 0){
  newURL = "/" + newURL;
  bQuicklink = true;
}

if (newURL.match("[0-9]$")){
  newURL = newURL + "-www";
  bQuicklink = true;
}

if (newURL.match(/\d{1,5}-www|\d{1,5}-INT/)){
  newURL = "http://" + window.location.host + basePath + "/" + newURL ;
  bQuicklink = true;
}
}
if (bQuicklink == true){
        window.location.href = newURL;
return(false);
}else{
return(true);
}
}

-----Ursprüngliche Nachricht-----
Von: daisy-bounces@...
[mailto:daisy-bounces@...]Im Auftrag von Lou Parisi
Gesendet: Freitag, 14. August 2009 00:13
An: daisy@...
Betreff: [daisy] Search box with document id



By default if I put a document ID (2180-DSY) into the daisy search box and
search it does not recognize this as a daisy document and comes up with no
matches.  Can anyone give some ideas if there is an easy way to customize
the search to do this.  I found one post about customizing the search box
button to do a full lucene search.  Perhaps something similar could be done
to see if the search is daisy document format and if so then go to the
specific document.  I'm not sure where to start so any help would be
appreciated.
--
View this message in context: http://www.nabble.com/Search-box-with-document-id-tp24960136p24960136.html
Sent from the Daisy - General mailing list archive at Nabble.com.

_______________________________________________
daisy community mailing list
Professional Daisy support: http://outerthought.org/en/services/daisy/support.html
mail to: daisy@...
list information: http://lists.cocoondev.org/mailman/listinfo/daisy
_______________________________________________
daisy community mailing list
Professional Daisy support: http://outerthought.org/en/services/daisy/support.html
mail to: daisy@...
list information: http://lists.cocoondev.org/mailman/listinfo/daisy