WIP: Initial work to extract examples from the FOSDEM15 talk#32
WIP: Initial work to extract examples from the FOSDEM15 talk#32TechplexEngineer wants to merge 4 commits intoblevesearch:masterfrom
Conversation
mschoch
left a comment
There was a problem hiding this comment.
Looks like a good start, just a few minor suggestions.
content/docs/Query.md
Outdated
|
|
||
| q := bleve.NewTermQuery("golden") | ||
| req := bleve.NewSearchRequest(q) | ||
| req.Highlight = bleve.NewHighlightWithStyle("html") |
There was a problem hiding this comment.
I'm thinking that to keep these examples short and focused on how to use the query type being discussed, we should remove the lines which set req.Highlight.
content/docs/Query.md
Outdated
| q := bleve.NewTermQuery("golden") | ||
| req := bleve.NewSearchRequest(q) | ||
| req.Highlight = bleve.NewHighlightWithStyle("html") | ||
| req.Fields = []string{"discription"} |
There was a problem hiding this comment.
And same for req.Fields, it isn't required for this example and might confuse users about whether it is required or not.
content/docs/Query.md
Outdated
| log.Fatal(err) | ||
| } | ||
|
|
||
| fq := bleve.NewFuzzyQuery("Citrus") // HLBLEVE |
There was a problem hiding this comment.
We should remove the comment // HLBLEVE that was added to highlight the line in a particular way in the presentation.
|
Thanks for the input. As I work through this I'm wondering if more targeted examples with just the lines relevant to the query being discussed would be better. Rather than show a complete working program which gets quite repetitive and verbose, we would just show: tq1 := bleve.NewTermQuery("golden")
tq2 := bleve.NewTermQuery("Citrus")
q := bleve.NewConjunctionQuery([]bleve.Query{tq1, tq2})
req := bleve.NewSearchRequest(q)I'm thinking a better place for the more complete examples would be in an Thoughts? |
Maybe we have one complete example at the top, featuring MatchQuery since it is the most common. Then all the others just show the relevant lines that would be different for that type of query? |
Per the discussion in #31 here is the beginnings of work to add examples to the docs