Had some time during lunch, and figured out how to list the tech-notes in
descending order:
$ fossil sqlite3 -R myclone.fossil "SELECT substr(tagname,7), tagxref.rid,
max(tagxref.mtime) FROM tag, tagxref WHERE tagname GLOB 'event-*' AND
tagxref.tagid=tag.tagid GROUP BY 1 ORDER BY mtime DESC"
8d18bf27e9f9ff8b9017edd55afc35701407d418|35502|2457698.34868013
bfdf42305400f6caa441fa816cb89231e90f8c82|22576|2456530.81914164
a1f9f17b603022c2b032bc3b2bff81118fd68d36|12285|2455688.26677552
d6ba73e22bf6ecbac3b6debb47ca2e15d5e63630|9650|2455502.26658565
be8f2f3447ef2ea3344f8058b6733aa08c08336f|9093|2455478.94143519
347871278941bd7ad08b27cde6a7b8f495c1f905|8915|2455475.02833333
However I can't seem to use those results as part of the search results.
Where should I look for errors, to track down what I'm overlooking? Is
there a log or a way to turn on debug output? Is it an issue with body()?
Here is what I've got in src/search.c:
if( (srchFlags & SRCH_WIKI)!=0 ){
db_multi_exec(
"WITH wiki(name,rid,mtime) AS ("
" SELECT substr(tagname,6), tagxref.rid, max(tagxref.mtime)"
" FROM tag, tagxref"
" WHERE tag.tagname GLOB 'wiki-*'"
" AND tagxref.tagid=tag.tagid"
" GROUP BY 1"
")"
"INSERT INTO x(label,url,score,id,date,snip)"
" SELECT printf('Wiki: %%s',name),"
" printf('/wiki?name=%%s',urlencode(name)),"
" search_score(),"
" 'w'||rid,"
" datetime(mtime),"
" search_snippet()"
" FROM wiki"
" WHERE search_match(title('w',rid,name),body('w',rid,name));"
);
db_multi_exec(
"WITH technote(uuid,rid,mtime) AS ("
" SELECT substr(tagname,7), tagxref.rid, max(tagxref.mtime)"
" FROM tag, tagxref"
" WHERE tag.tagname GLOB 'event-*'"
" AND tagxref.tagid=tag.tagid"
" GROUP BY 1"
")"
"INSERT INTO x(label,url,score,id,date,snip)"
" SELECT printf('Tech Note: %%s',uuid),"
" printf('/technote/%%s',uuid),"
" search_score(),"
" 'e'||rid,"
" datetime(mtime),"
" search_snippet()"
" FROM technote"
" WHERE search_match('',body('e',rid,NULL));"
);
}
I've tried placing the technote's db_multi_exec() before and after the
existing one, but it doesn't seem to make a difference (that I can see
anyway).
Thanks!
On Tue, Jan 24, 2017 at 10:37 PM, Richard Hipp <[email protected]> wrote:
> On 1/24/17, Chris Rydalch <[email protected]> wrote:
> >
> > I started by trying to combine them, mainly because I'm not a very good
> > programmer (most of my experience is with Python), and I was thinking
> this
> > would be the easiest way.
> >
>
> I agree that combining tech-notes with wiki seems like the best approach.
>
> --
> D. Richard Hipp
> [email protected]
> _______________________________________________
> fossil-users mailing list
> [email protected]
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users