[Groonga-commit] groonga/gcs [master] Use returned endpoints correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Aug 22 20:07:46 JST 2012


YUKI Hiroshi	2012-08-22 20:07:46 +0900 (Wed, 22 Aug 2012)

  New Revision: ae140358440a6d6660cc7b4af50ae3d2ab955fc9
  https://github.com/groonga/gcs/commit/ae140358440a6d6660cc7b4af50ae3d2ab955fc9

  Log:
    Use returned endpoints correctly

  Modified files:
    bin/gcs-import-examples

  Modified: bin/gcs-import-examples (+7 -3)
===================================================================
--- bin/gcs-import-examples    2012-08-22 19:52:09 +0900 (98e777d)
+++ bin/gcs-import-examples    2012-08-22 20:07:46 +0900 (9fd3e02)
@@ -53,10 +53,14 @@ echo
 
 echo "==== Creating 'example' domain"
 
-curl -s "http://localhost:7575/?DomainName=example&Action=CreateDomain&Version=2011-02-01"
+create_domain_result=`curl -s "http://localhost:7575/?DomainName=example&Action=CreateDomain&Version=2011-02-01"`
+echo $create_domain_result
 echo
 echo
 
+documents_endpoint=`echo "$create_domain_result" | sed -r -e "s/.+<DocService><Endpoint>//" | sed -r -e "s/<.+//"`
+search_endpoint=`echo "$create_domain_result" | sed -r -e "s/.+<SearchService><Endpoint>//" | sed -r -e "s/<.+//"`
+
 echo "==== Adding index fields"
 echo "== Creating 'name' field"
 curl -s "http://localhost:7575/?Action=DefineIndexField&DomainName=example&IndexField.IndexFieldName=name&Version=2011-02-01"
@@ -82,7 +86,7 @@ do
     fi
 done
 
-curl -X POST --upload-file $sdf_path --header "Content-Type: application/json" http://doc-example-00000000000000000000000000.127.0.0.1.xip.io:7575/2011-02-01/documents/batch
+curl -X POST --upload-file $sdf_path --header "Content-Type: application/json" http://$documents_endpoint/2011-02-01/documents/batch
 echo
 
 echo
@@ -92,7 +96,7 @@ cat <<EOT
 
 Now you can try searching by
 
-$ curl "http://search-example-00000000000000000000000000.127.0.0.1.xip.io:7575/2011-02-01/search?q=Tokyo"
+$ curl "http://$search_endpoint/2011-02-01/search?q=Tokyo"
 
 or, open
 http://localhost:7575
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index