Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

advanced search page #372

Closed
mblakele opened this issue Jan 9, 2015 · 21 comments
Closed

advanced search page #372

mblakele opened this issue Jan 9, 2015 · 21 comments

Comments

@mblakele
Copy link
Contributor

mblakele commented Jan 9, 2015

Add an advanced search page that provides basic functionality for each of the defined search constraints.

@mblakele
Copy link
Contributor Author

mblakele commented Mar 3, 2015

@dmcassel @dsokolsky where do you think this should go in the UI?

@dmcassel
Copy link
Contributor

dmcassel commented Mar 3, 2015

I'd toss that question to Steve Gehring

@mblakele
Copy link
Contributor Author

mblakele commented Mar 4, 2015

@stephen-gehring-ml

@dsokolsky
Copy link
Contributor

OK, here is how I think we should structure this page for now:

  • Replace the "Main site" link in the upper right corner of the header to say "Advanced" in a similarly small font.
  • Have that link take you to the search page with an extra form in it that has a search box (populated with whatever was in the search form in the header, if anything) and whatever search forms there are.
  • On the search page, have a link to show/hide the advanced search form, and make it shown if the user clicked the Advanced button at the upper right or if they did a search that was populated by the advanced form, or hidden (with a link that says "Advanced" to unhide it) for searches that are originated from the upper right search bar.

Is this enough to get you going with it Mike?

@mblakele
Copy link
Contributor Author

I think so. I have something more or less working and I'll check it in after a little more testing. We can iterate on feedback.

mblakele added a commit that referenced this issue Mar 19, 2015
@mblakele
Copy link
Contributor Author

This seemed like a good time to use a topic branch, but let me know if you'd rather just have this in the docapp branch.

@mblakele mblakele assigned dsokolsky and unassigned mblakele Mar 19, 2015
@mblakele mblakele added the test label Mar 19, 2015
@dsokolsky dsokolsky assigned mblakele and unassigned dsokolsky Mar 19, 2015
@dsokolsky dsokolsky removed the test label Mar 19, 2015
@dsokolsky
Copy link
Contributor

I think it is OK on this topic branch for now. I just tried it out and I am seeing this:

/do-search?advanced=1

SEARCH-INVALARGS: (err:FOER0000) Invalid arguments: output must be 'search:query' or 'cts:query'
in /MarkLogic/appservices/search/search.xqy, at 29:9,
in search:parse("", falsefalse</return-..., "cts:annotated-query") [1.0-ml]
$qtext = ""
$options = falsefalse</return-...
$output = "cts:annotated-query"
in /controller/search.xqm, at 522:2,
in ss:query-parts("") [1.0-ml]
$q = ""
in /view/page.xsl, at 28:0 [XSLT]
fn:context-item() = fn:doc("/apidoc/do-search.xml")
fn:position() = 1
in /view/page.xsl, at 460:0 [XSLT]
in /view/page.xsl, at 124:0 [XSLT]
in /view/page.xsl, at 389:0 [XSLT]
in /view/page.xsl, at 378:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 332:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 127:0,
in xdmp:xslt-invoke("/view/page.xsl", fn:doc("/apidoc/do-search.xml"), map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:map="http://marklogic.com/xdmp/map"><map:entry key="params">map:value/apidoc/do-.../map:map)) [XSLT]
in /apidoc/controller/transform.xqy, at 20:0 [1.0-ml]

@mblakele
Copy link
Contributor Author

Odd, it doesn't do that on my 8.0-1.1 install. Maybe a change in the search API? Should be easy enough to work around, though.

@mblakele mblakele assigned dsokolsky and unassigned mblakele Mar 19, 2015
@dmcassel
Copy link
Contributor

You mentioned replacing the Main Site link. I'm with you that the advanced search link would be good there, but we should have a link somewhere to the company site -- preferably more prominent than the current one.

@kcoleman-marklogic
Copy link
Contributor

Danny, were you trying this on pubs or pubs-new? I suspect you're on pubs and ML7. Mike's search:parse call is using "cts:annotated-query", which smells like this incompatibility to me:

http://docs.marklogic.com/guide/relnotes/chap4#id_20029

@dsokolsky
Copy link
Contributor

@dmcassel , as far as the link to the main site, I think that should get incorporated into the new header design (if that every happens).

@dsokolsky dsokolsky assigned mblakele and unassigned dsokolsky Mar 19, 2015
@dsokolsky
Copy link
Contributor

Kim is correct, I am running MarkLogic 7.

I get farther now, but now I am seeing this error with this request:

/do-search?api=false&v=&advanced=1&q=&q_none=&q_cat=&q_title=javascript

SEARCH-INVALARGS: (err:FOER0000) Invalid arguments: output must be 'search:query' or 'cts:query'
in /MarkLogic/appservices/search/search.xqy, at 29:9,
in search:parse("title:javascript", falsefalse</return-..., "cts:annotated-query") [1.0-ml]
$qtext = "title:javascript"
$options = falsefalse</return-...
$output = "cts:annotated-query"
in /controller/search.xqm, at 524:4,
in ss:query-parts("title:javascript") [1.0-ml]
$q = "title:javascript"
in /view/page.xsl, at 28:0 [XSLT]
fn:context-item() = fn:doc("/apidoc/do-search.xml")
fn:position() = 1
in /view/page.xsl, at 460:0 [XSLT]
in /view/page.xsl, at 124:0 [XSLT]
in /view/page.xsl, at 389:0 [XSLT]
in /view/page.xsl, at 378:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 332:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 150:0 [XSLT]
in /view/page.xsl, at 127:0,
in xdmp:xslt-invoke("/view/page.xsl", fn:doc("/apidoc/do-search.xml"), map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:map="http://marklogic.com/xdmp/map"><map:entry key="params">map:value/apidoc/do-.../map:map)) [XSLT]
in /apidoc/controller/transform.xqy, at 20:0 [1.0-ml]

@mblakele
Copy link
Contributor Author

I suspect you'll be running ML8 for docs by the time we work out the full UI for this. But meanwhile it's good sample code for anyone looking at how to handle incompatibilities.

@dsokolsky
Copy link
Contributor

Well, production is still running 7.0....

@dsokolsky
Copy link
Contributor

We need to migrate the environments to Red Hat 6, that is why it is not there yet.

mblakele added a commit that referenced this issue Mar 19, 2015
@mblakele mblakele added the test label Mar 19, 2015
@mblakele mblakele assigned dsokolsky and unassigned mblakele Mar 19, 2015
@mblakele
Copy link
Contributor Author

This time I tested with ML7 and ML8.

This is actually a new branch with the same name, but different history. I deleted the old one so I could rebase from the latest docapp. Sorry if that's confusing: not usual practice, but it's a topic branch. Anyway you may want to delete the old copy and get the new one:

git checkout docapp
git branch -D docapp-372-advanced-search
git checkout docapp-372-advanced-search

@dsokolsky
Copy link
Contributor

OK, I got it to work. Here are a few things:

  • It should have a link on the search page (maybe to the bottom right of the form) to go back to the regular search page. It could just hide it but keep it in the html maybe?
  • Should the category be a drop down?

@mblakele
Copy link
Contributor Author

One quick way to get back to normal search is to use the old search box in the upper right corner.

The nice thing about this preliminary UI is that it doesn't require javascript. But I agree that there should be better UI. I tend to think it should either act like a sub-panel with a show-hide widget, or a pseudo-window with its own open-close widget. Thoughts?

In the long run I'd like to see a fairly capable query builder, something like this. But it's going to take a while to get there.

img

@dsokolsky
Copy link
Contributor

I was thinking that we could always include it, but hide it via css when you click a link (Advanced). So I think it should be a sub-panel with a show-hide widget.

The lack of javascript thing does not seem like such a big deal, seeing as how javascript is pretty necessary for the app anyway...

@mblakele
Copy link
Contributor Author

@dsokolsky This may be functional enough as far as the data model and JavaScript are concerned: see what you think. If you want to tweak any of the CSS or container XML that's all in screen.css and search.xsl.

@dsokolsky
Copy link
Contributor

Anything new deserves a new bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants