This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<form class="lift:InventoryCreate?form=post;multipart=true"> | |
<fieldset> | |
<legend><span>Main Information</span></legend> | |
<ol> | |
<li><label for="part_number">Part Number</label> | |
<input id="part_number" name="part_number" class="text" type="text" /><br> | |
<p id="part_number_error" class=""></p> | |
</li> | |
<li><label for="description">Description:</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val cometClass= "MyCometClass" | |
lazy val name= net.liftweb.util.Helpers.nextFuncName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="lift:PutCometOnPage"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CometListerner.listenerFor(Full(item)) match { | |
case a: LiftActor => info(bid); a ! Message(item, (bid.toDouble + 1.00)) | |
case _ => info("No actor to send an update") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X DELETE "http://localhost:9200/articles" | |
curl -X POST "http://localhost:9200/articles/article/1" -d ' | |
{ | |
"title" : "One" | |
}' | |
curl -X POST "http://localhost:9200/articles/article/2" -d ' | |
{ | |
"title" : "Two" | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST "http://localhost:9200/articles/_search?pretty=true" -d ' | |
{ | |
"query" : { "query_string" : {"query" : "T*"} }, | |
"facets" : { | |
"tags" : { "terms" : {"field" : "tags"} } | |
} | |
} | |
' | |
{ | |
"took" : 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST "http://localhost:9200/articles/_search?pretty=true" -d ' | |
{ | |
"query" : { "query_string" : {"query" : "T*"} }, | |
"filter" : { "type": { "value": "article" }} , | |
"facets" : { | |
"tags" : { "terms" : {"field" : "tags"} } | |
} | |
} | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"facets" : { | |
"tags" : { | |
"_type" : "terms", | |
"missing" : 0, | |
"total" : 2, | |
"other" : 0, | |
"terms" : [ { | |
"term" : "foo", | |
"count" : 2 | |
} ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> | |
scala> import net.liftweb.json._ | |
import net.liftweb.json._ | |
scala> | |
scala> implicit val formats = DefaultFormats | |
formats: net.liftweb.json.DefaultFormats.type = net.liftweb.json.DefaultFormats$@33462704 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InventorySearch extends Logger with myScalaz.Boxes { | |
def results = { | |
val searchBoxText= S.param("p") | |
val doSearch= new DoSearch | |
lazy val searchResult= doSearch.queryElasticSearch(searchBoxText) // Returns Elastic Search results in json format | |
lazy val invItems= | |
searchResult map { x => |